Google map API v3 markers overlapping
Asked Answered
E

2

10

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??

Estabrook answered 24/11, 2011 at 13:49 Comment(1)
This feature has been "Acknowledge" with issue 119 in gmaps-api-issues since 2009... code.google.com/p/gmaps-api-issues/issues/detail?id=119Hawfinch
W
7

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

Whole answered 7/2, 2012 at 1:39 Comment(1)
Just an FYI, I actually did use this on the live site, and it is working really well. yourmapper.com/map.php Feel free to mark the answer solved if you like it :).Whole
H
1

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

Hawfinch answered 31/10, 2013 at 17:52 Comment(2)
The better solution if its just a standard library with no need for tweakingSkaggs
This does not help if the markers still overlap at the maximum zoom levelOrthodontics

© 2022 - 2024 — McMap. All rights reserved.