2016-07-28 119 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.