2015-02-05 137 views
-1

我有下面的代碼安裝到應用映射表中用於各種領域谷歌地圖API - 灰度

var locations = [ 
    ['Liver Office - Liverpool Office', 53.40529, -2.988801, 1], 
    ['Lond office - London Office', 51.515026, -0.086811, 2], 

]; 
function plotMap(loc) { 

var mapOptions = { 
    zoom: 17, 
    center: new google.maps.LatLng((locations[loc][1]), (locations[loc][2])), 
    stylers: [ 
    { saturation: -100 } // <-- THIS 
    ] 
}; 

var map = new google.maps.Map(document.getElementById('map'), 

    mapOptions); 

var marker = new google.maps.Marker({ 
    position: map.getCenter(), 
    map: map, 
    mapTypeControlOptions: { 
    mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'tehgrayz'] 
    }, 
    icon: 'marketICO.png', 
    title: (locations[loc][0]) 
}); 

var infowindow = new google.maps.InfoWindow(); 
    google.maps.event.addListener(marker, 'click', (function(marker) { 
    return function() { 
     infowindow.setContent(locations[loc][0]); 
     infowindow.open(map, marker); 
    } 
    })(marker, loc)); 
} 

$('.livLink').click(function(){ 
    plotMap(0); 
}); 
$('.lonLink').click(function(){ 
    plotMap(1); 
}); 
    plotMap(0); 

有沒有人設法讓自己的地圖灰階 - 我也曾有過一些嘗試 - 包括以上 - 但到目前爲止沒有運氣..

+1

我建議問第二個問題的第二個問題。你可能會得到更好的迴應。 – 2015-02-05 13:38:52

+0

點 - 我已經打開了第二個問題 - http://stackoverflow.com/questions/28345745/google-maps-map-reload – Dancer 2015-02-05 13:54:37

回答