Google 静态地图显示的图钉不超过 5 个

Google static map not showing more than 5 pins

我尝试了所有方法,但无论我做什么,静态 Google 地图现在显示超过 5 个图钉。 我的静态图 URL 是 https://maps.googleapis.com/maps/api/staticmap?center=43.508708883,16.439189110&zoom=7&size=640x320&key=MY_API_KEY&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-1.png?v=7|43.508708,16.439189&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-2.png?v=7|43.172360,16.441608&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-3.png?v=7|42.787800,17.345000&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-4.png?v=7|42.650600,18.091400&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-5.png?v=7|42.958300,17.134400&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-6.png?v=7|43.296700,17.017800&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-7.png?v=7|43.444400,16.688300&markers=icon:http://test2018.adriagate.com/images/pin-number-icon-8.png?v=7|43.508708,16.439189

似乎够短了,因为限制是2048个字符。它只有 8 个引脚。如果它有地址而不是纬度和经度,那么只有限制是标记。

我浪费了几个小时,无论我做什么,都没有显示引脚 6、7 和 8。 是的,如您所见,它们存在于服务器上: http://test2018.adriagate.com/images/pin-number-icon-8.png

这是静态地图的记录行为 API。

看看这个页面 https://developers.google.com/maps/documentation/maps-static/dev-guide#Markers

有如下语句

You can use up to five unique custom icons per request. This limitation does not mean that you are limited to only 5 marked locations on your map. Each unique icon may be used with more than one markers location on your map.

Google 问题跟踪器中也有功能请求允许超过 5 个独特的图标: https://issuetracker.google.com/issues/35825584

但是,Google 将此功能请求标记为重复以支持关于静态地图中 KML 图层的另一个功能请求:

https://issuetracker.google.com/issues/35817020

随时为功能请求加注星标以表达您的兴趣。

希望我的回答能解开你的疑惑。