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

问题描述 投票:1回答:1

我已经尝试了所有方法,但是无论我做什么,静态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

google-maps google-static-maps
1个回答
2
投票

这是Static Maps API的已记录行为。

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

有以下陈述

每个请求

您可以使用最多五个唯一的自定义图标。此限制并不意味着您只能在地图上标记5个位置。每个独特的图标可能与地图上的多个标记位置一起使用。

[Google问题追踪器中也有功能要求,以允许5个以上的独特图标:https://issuetracker.google.com/issues/35825584

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

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

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

希望我的回答能澄清您的疑问。

© www.soinside.com 2019 - 2024. All rights reserved.