谷歌地图API V3 - 同一地点的多个标记 [英] Google maps API V3 - multiple markers on exact same spot

查看:226
本文介绍了谷歌地图API V3 - 同一地点的多个标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一点卡住了。我正在通过JSON检索地理坐标列表并将它们弹出到谷歌地图上。除了在同一地点有两个或更多标记的情况以外,所有工作都很好。 API只显示1个标记 - 最上面的一个。这是公平的,我想,但想找到一种方式来显示他们所有莫名其妙。



我搜索谷歌,并找到一些解决方案,但他们大多似乎是对于API的V2或者没那么好。理想情况下,我希望有一种解决方案,您可以点击某种组标记,然后显示标记聚集在他们所在的位置。



任何人遇到此问题或相似,并会分享一个解决方案?

OverlappingMarkerSpiderfier 。点击
有一个演示页面,但他们不显示标记,其是完全在同一地点,其中只有一些非常接近一起。 -vor-ort /rel =noreferrer> http://www.ejw.de/ejw-vor-ort/ (向下滚动地图并点击几个标记以查看蜘蛛效果)。/ b>

这似乎是解决您问题的最佳解决方案。


Bit stuck on this one. I am retrieving a list of geo coords via JSON and popping them onto a google map. All is working well except in the instance when I have two or more markers on the exact same spot. The API only displays 1 marker - the top one. This is fair enough I suppose but would like to find a way to display them all somehow.

I've searched google and found a few solutions but they mostly seem to be for V2 of the API or just not that great. Ideally I'd like a solution where you click some sort of group marker and that then shows the markers clustered around the spot they are all in.

Anybody had this problem or similar and would care to share a solution?

解决方案

Take a look at OverlappingMarkerSpiderfier.
There's a demo page, but they don't show markers which are exactly on the same spot, only some which are very close together.

But a real life example with markers on the exact same spot can be seen on http://www.ejw.de/ejw-vor-ort/ (scroll down for the map and click on a few markers to see the spider-effect).

That seems to be the perfect solution for your problem.

这篇关于谷歌地图API V3 - 同一地点的多个标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆