OverlappingMarkerSpiderfier-Leaflet
OverlappingMarkerSpiderfier-Leaflet copied to clipboard
out of need
Thank you for this fine library. I did some cleanup and modernization to it in hopes that it would help me and thought I'd offer it if needed.
Thanks again.
I went ahead and created a full fledged control that should make reuse pretty easy and simplified some of the terminology. You can now do this with this branch:
L.spiderfy({
map: map,
markers: markers,
click: function(marker) {
popup.setContent(marker.desc);
popup.setLatLng(marker.getLatLng());
map.openPopup(popup);
},
activate: function(markers) {
markers.forEach(function(marker) {
marker.setIcon(new LightIcon());
});
map.closePopup();
},
deactivate: function(markers) {
markers.forEach(function(marker) {
marker.setIcon(new DarkIcon());
});
}
});
I don't trust it.
What?