simnom of ifour
3/8/2016 - 2:27 PM

Black and white Google map

Black and white Google map



var map;

thelocation = {
  lat:0,
  lng:0
};

function initMap() {
    if (document.getElementById('map')) {
        map = new google.maps.Map(document.getElementById('map'), {
            center: thelocation,
            zoom: 17,
            disableDefaultUI: true,
    		scrollwheel: false
        });

        // Map Styles
    	var blackAndWhite = [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}];
    	map.setOptions({styles: blackAndWhite});
        // Custom SVG Icon tingymajig
        var iconNormal = {
            path: "M20.934,0.2C33.751,0.2,41,3.616,41,8.2s-7.249,8-20.066,8S0.2,12.784.2,8.2,8.118,0.2,20.934.2Zm0,2c10.986,0,18.059,2.249,18.059,6s-7.073,6-18.059,6-18.727-2.25-18.727-6S9.949,2.2,20.934,2.2ZM21,5c4.866,0,8,1.225,8,2.8s-3.134,2.8-8,2.8-8-1.225-8-2.8S16.133,5,21,5Z",
            fillColor: '#393d3f',
            fillOpacity: 0,
            anchor: new google.maps.Point(0,0),
            strokeWeight: 3,
            strokeColor:'#393d3f',
            scale: 1
        };

        var marker = new google.maps.Marker({
    		position: thelocation,
    		map: map,
    		title: "The Location",
    		icon: iconNormal
    	});
    }
}