2016-11-22 49 views
0

我有寫在java腳本中的變量樣式,但我不知道在哪裏放置它,以便它開始工作。將樣式添加到Google Maps API?

我試圖把它的功能initmap(內部){..但它不工作。 https://jsfiddle.net/hute2o63/8/ 這裏是我的風格:

var featureOpts = [ { "featureType": "landscape", "stylers": [ { "hue": "#FFA800" }, { "saturation": 0 }, { "lightness": 0 }, { "gamma": 1 } ] }, { "featureType": "road.highway", "stylers": [ { "hue": "#53FF00" }, { "saturation": 0 }, { "lightness": -1.4210854715202004e-14 }, { "gamma": 1 } ] }, { "featureType": "road.arterial", "stylers": [ { "hue": "#FBFF00" }, { "saturation": 0 }, { "lightness": 0 }, { "gamma": 1 } ] }, { "featureType": "road.local", "stylers": [ { "hue": "#00FFFD" }, { "saturation": 0 }, { "lightness": 0 }, { "gamma": 1 } ] }, { "featureType": "water", "stylers": [ { "hue": "#0078FF" }, { "saturation": 0 }, { "lightness": 0 }, { "gamma": 1 } ] }, { "featureType": "poi", "stylers": [ { "hue": "#9FFF00" }, { "saturation": 0 }, { "lightness": 0 }, { "gamma": 1 } ] } ]; 

任何幫助嗎?

+1

試試這個頁面,它可能有所幫助 - https://developers.google.com/maps/documentation/javascript/styling –

+1

展望你的jsfiddle,你在這裏沒有提供一個有效的API-KEY:'

相關問題