Skip to content

Instantly share code, notes, and snippets.

@MSerj
Created November 16, 2017 12:38
Show Gist options
  • Save MSerj/21df7459fc94f2d5189f27c887419933 to your computer and use it in GitHub Desktop.
Save MSerj/21df7459fc94f2d5189f27c887419933 to your computer and use it in GitHub Desktop.
Google map gray
function initMap() {
var mapCanvas = document.getElementById('map');
var myLatlng = new google.maps.LatLng(43.235501, 13.633698);
var mapOptions = {
center: myLatlng,
zoom: 17,
disableDefaultUI: true,
styles: [
{
featureType: "all",
elementType: "all",
stylers: [
{ saturation: -100 } // <-- THIS
]
}
]
};
var map = new google.maps.Map(mapCanvas, mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: 'img/map-marker.png'
});
}
if ($('#map').length > 0) {
google.maps.event.addDomListener(window, 'load', initMap);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment