Overlapping markers on your Google Map? Meet 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 exact same thing doesn’t happen?
This code makes Google Maps API version 3 map markers behave in that Google Earth way. Small numbers of markers (up to 8, configurable) spiderfy into a circle. Larger numbers fan out into a (more space-efficient) spiral.
Try it! (You can reload this page to re-randomise the marker positions).
The code is MIT licenced, has no dependencies, and is under 3K compiled (from CoffeeScript), minified and gzipped. I wrote it as part of the data download feature for Mappiness.
It’s on Github, where you can find out more, download or fork the code.
-
jawj
-
jawj
-
jawj
-
Martin
-
Martin
-
Tom Duke
-
Tom Duke
-
Loughlin McSweeney
-
Daniel Cox
-
Loughlin McSweeney
-
Loughlin McSweeney
-
reinaldo de almeida
-
reinaldo de almeida
-
Deb
-
Vani Hemmige
-
Danie
-
marcelo
-
jorge
-
Pardeep Beniwal
-
Mohit Verma
-
Mohit Verma
-
MWWST