Google 地图 API v3 标记重叠

发布于 2024-12-17 17:49:41 字数 118 浏览 3 评论 0原文

我正在使用谷歌地图制作一个应用程序。

当标记重叠时,即使图标不同,也仅显示最后一个。

我不希望它在这种情况下聚集,而是应该通过更改坐标来显示两者,但是?

有什么解决办法吗??

I am making an application with google maps.

When markers are overlapping only the last one is displayed even if the icons are different..

I do not want it to cluster in that case, rather it should show both maybe by changing the coordinates just a but??

Any solutions??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

硪扪都還晓 2024-12-24 17:49:41

我认为这是一个非常优雅的解决方案,称为“蜘蛛化标记”。

https://github.com/jawj/OverlappingMarkerSpiderfier

我正在考虑使用它。

我现在做的是使用 JavaScript 制作一个精美的弹出窗口,隐藏和显示一个标记位置上的 div(在 PHP 中创建有问题,但您也可以在 JS 上执行此操作)。它的另一个好处是可以减少地图上的标记。

单击此地图上的黑色编号标记即可查看其实际情况。
http://www.yourmapper。 com/map/111/crime-reports/crime-in-metro-louisville-ky-since-jan-2003.htm

I think this is a pretty elegant solution, called Spiderfying the markers.

https://github.com/jawj/OverlappingMarkerSpiderfier

I'm thinking of using it.

What I do now is use JavaScript to make a fancy popup that hides and shows divs on one marker location (created problematically in PHP, but you could do it on JS too). It has the side benefit of allowing less markers on the map.

Click a black numbered marker on this map to see it in action.
http://www.yourmapper.com/map/111/crime-reports/crime-in-metro-louisville-ky-since-jan-2003.htm

甜点 2024-12-24 17:49:41

Another option is to use Google Maps API 3 Utility Library, it has a Marker Clusterer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文