As I am getting the same latitude and longitude from database for different markers, the markers are getting pin on each other, now I want to perform click event on makers alternatively, but only the top marker pin is clicked, how can I click the back one .
Asked
Active
Viewed 407 times
-1
-
possible duplicate of [allow user to move marker position back (z-index?) in google maps custom map](http://stackoverflow.com/questions/29279202/allow-user-to-move-marker-position-back-z-index-in-google-maps-custom-map) – geocodezip Oct 02 '15 at 12:55
1 Answers
0
OverlappingMarkerSpiderfier is the solution: https://github.com/jawj/OverlappingMarkerSpiderfier
Ever noticed how, in Google Earth, marker pins that overlap each other spring apart gracefully when you click them, so you can pick the one you meant?
And ever noticed how, when using the Google Maps API, the same thing doesn’t happen?
This code makes Google Maps API version 3 map markers behave in that Google Earth way (minus the animation). Small numbers of markers (yes, up to 8) spiderfy into a circle. Larger numbers fan out into a more space-efficient spiral.
Demo page is here: http://jawj.github.io/OverlappingMarkerSpiderfier/demo.html

Ivan Jovović
- 5,238
- 3
- 29
- 57
-
I am getting the markers pinned at exactly the same location due to the same latitude & longitude values coming from database . And when the Markers get Spiderfier (Markers Expands or Separate from each other) I also want to perform click operation on maker. But in the example markers get collapsed when click is performed second time. – Sajid Syed Oct 08 '15 at 07:12
-
https://github.com/jawj/OverlappingMarkerSpiderfier: `keepSpiderfied (default: false)`. By default, the OverlappingMarkerSpiderfier works like Google Earth, in that when you click a spiderfied marker, the markers unspiderfy before any other action takes place. Since this can make it tricky for the user to work through a set of markers one by one, you can override this behaviour by setting the keepSpiderfied option to true. – Ivan Jovović Oct 08 '15 at 07:37