Google静态映射多个自定义标记图标

时间:2016-07-28 07:24:46

标签: google-maps static

我试图在一张地图上获得多个自定义图标标记。我知道如何制作一个(icon = ...)但我只获得了最后一次......见下图,我创建了标记"测试1","测试2&#34 ;和"测试3"但只有"测试3"出现......

Image

1 个答案:

答案 0 :(得分:2)

您可以这样添加: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.

修改2: Google Supports custom marker points