Google map API v3 markers overlapping

loo picture loo · Nov 24, 2011 · Viewed 9.4k times · Source

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

Answer

Michael S picture Michael S · Feb 7, 2012

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