jawj / OverlappingMarkerSpiderfier-Leaflet

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

unspiderfy() should always fire 'unspiderfy' event #32

Closed MuellerMatthew closed 8 years ago

MuellerMatthew commented 8 years ago

When the unspiderfy() method is called it should always fire the 'unspiderfy' event before the method returns, even if no markers were spiderfied or moved to confirm to other listeners that all markers on the map are now unspiderfied.

When modifying or moving points and measuring distances, it is sometime useful to have method which only runs when you have confirmed all of the markers are unspiderfied. This means you need to set a listener for the 'unspiderfy' function which listens to the event that is emitted when you call oms.unspiderfy() so that after all of the markers are unspiderfied, you can have a callback which modifies, moves, or measures distances between the points.

dwiyatci commented 6 years ago

@MuellerMatthew Do you have a good workaround for this? Seems like I also need it for my case. 🤷‍♂️