Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google map API v3 markers overlapping

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

like image 880
loo Avatar asked Nov 24 '11 13:11

loo


1 Answers

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

like image 67
Michael S Avatar answered Sep 19 '22 15:09

Michael S