I am trying to integrate OverlappingMarkerSpiderfier into my project, which is using leaflet. If I look at the demo, I have to believe that this works, however, I would like to load the map in a state that markers close to each-other are expended instead of having to click on any group. However, from the docs I can not really see how this can be done and I am worried about zoom events as well, as the demo collapses the groups on any zoom events.
So, my question is as follows: How can I use OverlappingMarkerSpiderfier for leaflet to expand all groups at map load and recalculate at map zoom?
EDIT:
This is how I tried to use it:
var omsOptions = {
keepSpiderfied: true,
nearbyDistance: 300
};
var oms = new OverlappingMarkerSpiderfier(map, omsOptions);
for (var cachedMarkerIndex in cachedMarkers) {
oms.addMarker(cachedMarkers[cachedMarkerIndex]);
}
hoping that keepSpiderfied will keep them spiderfied, but not only it is not initializing the markers in a spiderfied way, but also it collapses the markers if I click on an arbitrary location on the map. I really do not intend to criticize the library, as I believe it is a wonderful idea and kudos for its author, however, if the features I need are not supported, then I will have to write my own library instead of using this one.