Created
January 23, 2015 16:11
-
-
Save greywillfade/96f186ecb64cd5cfed86 to your computer and use it in GitHub Desktop.
Sample Google Map styling
This file contains 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
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=APIKEYHERE"></script> | |
<script type="text/javascript"> | |
var map; | |
var maplocation = new google.maps.LatLng(LAT, LONG); | |
function initialize() { | |
var atlasStyles = [ | |
{ | |
featureType: 'landscape.natural', | |
stylers: [ | |
{ lightness: 100 } | |
] | |
},{ | |
featureType: 'landscape.man_made', | |
stylers: [ | |
{ lightness: 100 } | |
] | |
},{ | |
featureType: 'road', | |
elementType: 'geometry.fill', | |
stylers: [ | |
{ color: '#cecece' }, | |
{ visibility: 'on' } | |
] | |
},{ | |
featureType: 'road', | |
elementType: 'geometry.stroke', | |
stylers: [ | |
{ visibility: "off" }, | |
{ lightness: 40 } | |
] | |
},{ | |
featureType: 'water', | |
elementType: 'geometry', | |
stylers: [ | |
{ color: '#00A1E0' }, | |
{ lightness: 65 } | |
] | |
} | |
]; | |
var mapOptions = { | |
zoom: 13, | |
draggable: false, | |
scrollwheel: false, | |
center: maplocation, | |
mapTypeControlOptions: { | |
mapTypeIds: [] | |
} | |
}; | |
map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); | |
var image = { | |
url: '../img/mappin.png', | |
scaledSize: new google.maps.Size(30, 44), | |
}; | |
var custMarker = new google.maps.Marker({ | |
position: maplocation, | |
map: map, | |
icon: image | |
}); | |
var LSRoadMapType = new google.maps.StyledMapType(atlasStyles); | |
map.mapTypes.set('usroadatlas', LSRoadMapType); | |
map.setMapTypeId('usroadatlas'); | |
} | |
google.maps.event.addDomListener(window, 'load', initialize); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment