2016-07-28 114 views
-1

我試圖在一張地圖上獲取多個自定義圖標標記。我知道如何製作一個(圖標= ...),但我只能得到最後一個多倍...參見下圖,我創建了標記「測試1」,「測試2」和「測試3」,但只有「測試3" 顯示出來......Google靜態地圖多個自定義標記圖標

Image

回答

1

您可以添加這樣:​​markers=icon:path_to_the_image|LAT,LNG

https://maps.googleapis.com/maps/api/staticmap 
?center=52.446925,4.815730&zoom=10&size=600x600&maptype=roadmap 
&markers=icon:http://cdn2.iconfinder.com/data/icons/integers/60/number-one-32.png|52.373670, 4.896718 
&markers=icon:http://cdn2.iconfinder.com/data/icons/integers/60/number-two-32.png|52.489908, 4.658677 
&markers=icon:http://cdn2.iconfinder.com/data/icons/integers/60/number-three-32.png|52.553214, 4.673812 
&key=API_KEY 

希望這有助於!

編輯:The Google Static Maps API does not support custom icon URLs that use HTTPS; the default icon will be displayed.