【问题标题】:Markers are not shown in static google map标记未显示在静态谷歌地图中
【发布时间】:2016-02-15 10:19:30
【问题描述】:

我以这种方式使用带有多个标记的谷歌静态地图网址。

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

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

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

  &maptype=roadmap
    &sensor=fasle

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

谢谢

【问题讨论】:

  • 请移除标签Java

标签: google-maps google-maps-api-3 google-static-maps


【解决方案1】:

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

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

请求后三个:

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-06-08
  • 2014-05-17
  • 1970-01-01
  • 2013-05-18
  • 2011-10-18
  • 1970-01-01
  • 2021-07-07
相关资源
最近更新 更多