gpt4 book ai didi

google-maps - 标记未显示在静态谷歌地图中

转载 作者:行者123 更新时间:2023-12-01 12:59:36 25 4
gpt4 key购买 nike

我以这种方式使用带有多个标记的谷歌静态 map url。

https://maps.googleapis.com/maps/api/staticmap?size=1100x795&markers=color:red|label:S|45.459041,-98.430198&markers=color:red|label:S|45.469042,-98.430199&markers=color:red%7Clabel:S%7C40.702147,-74.015794&markers=color:red%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284

但在 map 中只显示了 2 个标记。

static map from URL above

我什至尝试在 url 中添加这些参数,但它仍然只在我的 map 中显示 2 个标记。

  &maptype=roadmap
&sensor=fasle

这里有什么错误?有人可以帮助我吗?

谢谢

最佳答案

这是因为标记的距离。前两个标记彼此靠近,其他三个标记也彼此靠近,但前两个标记与后三个标记相对较远。我尝试分别获取静态 map 并分别请求前两个和后三个,并相应地显示标记。我猜是因为标记重叠的距离。

fiddle of Google Maps Javascript API v3 map showing the same markers (导航到标记以查看发生了什么)

前两个请求:

https://maps.googleapis.com/maps/api/staticmap?size=1100x795&markers=color:red|label:S|45.459041,-98.430198&markers=color:red|label:S|45.469042,-98.430199

enter image description here

后三者的要求:

https://maps.googleapis.com/maps/api/staticmap?size=1100x795&markers=color:red%7Clabel:S%7C40.702147,-74.015794&markers=color:red%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284

enter image description here

关于google-maps - 标记未显示在静态谷歌地图中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35406732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com