You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a set of filters on my map to limit which markers are shown.
If I limit the markers to only one marker is showing which would otherwise be clustered, the position is accurate as seen here. If I have both markers in the cluster, spiderfy, and then update the filters so that only one marker is left, the location of that marker is the position of where it spiderfied to instead of the location original location as seen here. The lines still showing is what's referenced in #53 and why i think they might be related.
When my filters change, I'm
Removing the cluster layer from the map
Re-initializing the cluster layer with new L.MarkerClusterGroup();
Loop through markers which should remain on the map and add their layers to the cluster layer
Once done, add the marker cluster layer to the map again
Below is the code
//Clear the current marker cluster group
me.map.removeLayer(me.markerCluster);
me.markerCluster = new L.MarkerClusterGroup();
//Go through items and update which are on the map
for(var id in me.markers)
{
//Add it to the layer group
me.markerCluster.addLayer(me.markers[id]);
}
me.map.addLayer(me.markerCluster);
Let me know if anymore information is needed!
The text was updated successfully, but these errors were encountered:
About to look at this.
My thought is that the spiderfier is updating the latlng of the marker when spiderfying (needed so that if we add a popup it is in the right place) but the original position is not being restored when the MarkerClusterGroup is removed from the map.
This may or may not be related to #53
I have a set of filters on my map to limit which markers are shown.
If I limit the markers to only one marker is showing which would otherwise be clustered, the position is accurate as seen here. If I have both markers in the cluster, spiderfy, and then update the filters so that only one marker is left, the location of that marker is the position of where it spiderfied to instead of the location original location as seen here. The lines still showing is what's referenced in #53 and why i think they might be related.
When my filters change, I'm
new L.MarkerClusterGroup();
Below is the code
Let me know if anymore information is needed!
The text was updated successfully, but these errors were encountered: