jawj / OverlappingMarkerSpiderfier-Leaflet

Deals with overlapping markers in the Leaflet maps API, Google Earth-style
253 stars 68 forks source link

question about zoom level #52

Open r1de opened 3 years ago

r1de commented 3 years ago

any way to easily have the spiderfy only active if the map zoom level is greater than X?
I only need the spiderfying on high zoom levels.
I am trying to avoid this behavior:
4th of July

jawj commented 3 years ago

You might want to try combining with clustering, then? But I don't know what clustering libraries are available for Leaflet.

r1de commented 3 years ago

That might do it. I will have to try that and see if it does what I want. Thanks for the reply!

r1de commented 3 years ago

Ended up using a fork of this code which allows for a simple spiderfy.enable() and spiderfy.disable().
https://github.com/robertleeplummerjr/OverlappingMarkerSpiderfier-Leaflet
I can now enable or disable the spidering effect based on zoom level.
Exactly the behavior I was after!

It seems like a long shot, but the PR(s) from that fork to this one should be accepted ASAP!
It makes this library much more useful than it already is! :smile:

fusilon94 commented 2 years ago

@r1de cans you please share the fork U use?

r1de commented 2 years ago

@fusilon94 It is the link in my comment above yours... https://github.com/robertleeplummerjr/OverlappingMarkerSpiderfier-Leaflet