Created
October 1, 2013 15:11
-
-
Save dyaa/6780006 to your computer and use it in GitHub Desktop.
Google Maps Styling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="map"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function () { | |
| var map; | |
| var centerPosition = new google.maps.LatLng(31.1980, 29.9192); | |
| var style = [{ | |
| "stylers": [{ | |
| "visibility": "off" | |
| }] | |
| }, { | |
| "featureType": "road", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#ffffff" | |
| }] | |
| }, { | |
| "featureType": "road.arterial", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#fee379" | |
| }] | |
| }, { | |
| "featureType": "road.highway", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#fee379" | |
| }] | |
| }, { | |
| "featureType": "landscape", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#f3f4f4" | |
| }] | |
| }, { | |
| "featureType": "water", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#7fc8ed" | |
| }] | |
| }, {}, { | |
| "featureType": "road", | |
| "elementType": "labels", | |
| "stylers": [{ | |
| "visibility": "off" | |
| }] | |
| }, { | |
| "featureType": "poi.park", | |
| "elementType": "geometry.fill", | |
| "stylers": [{ | |
| "visibility": "on" | |
| }, { | |
| "color": "#83cead" | |
| }] | |
| }, { | |
| "elementType": "labels", | |
| "stylers": [{ | |
| "visibility": "off" | |
| }] | |
| }, { | |
| "featureType": "landscape.man_made", | |
| "elementType": "geometry", | |
| "stylers": [{ | |
| "weight": 0.9 | |
| }, { | |
| "visibility": "off" | |
| }] | |
| }] | |
| var options = { | |
| zoom: 16, | |
| center: centerPosition, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP | |
| }; | |
| map = new google.maps.Map($('#map')[0], options); | |
| map.setOptions({ | |
| styles: style | |
| }); | |
| var image = { | |
| url: 'https://dl.dropboxusercontent.com/u/814783/fiddle/marker.png', | |
| origin: new google.maps.Point(0, 0), | |
| anchor: new google.maps.Point(12, 59) | |
| }; | |
| var shadow = { | |
| url: 'https://dl.dropboxusercontent.com/u/814783/fiddle/shadow.png', | |
| origin: new google.maps.Point(0, 0), | |
| anchor: new google.maps.Point(-2, 36) | |
| }; | |
| var marker = new google.maps.Marker({ | |
| position: centerPosition, | |
| map: map, | |
| icon: image, | |
| shadow: shadow | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #map { | |
| height: 500px; | |
| width: 500px; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment