Open seerj30 opened 3 years ago
Can you publish a fiddle/codepen/plunkr that displays this behaviour?
And I mean "without angular", because I've already seen https://stackoverflow.com/questions/69271376/marker-cluster-clearlayers-method-does-not-remove-the-layers-from-the-map
It will take a couple of hours to extract it. But I think I found something similar here: https://stackoverflow.com/questions/42862370/refresh-marker-clusters-after-geojson-layer-has-changed https://github.com/Leaflet/Leaflet.markercluster/issues/647#issuecomment-200188598 It's like the marker cluster group is decoupled from the map.
I'm using
"leaflet.markercluster": "^1.5.0"
into an Angular app. The marker cluster is created as follow:then is added to the map
this.map.addLayer(this.markerCluster);
. Adding markers to the marker cluster works like a charm (this.markerCluster.addLayers(this.markerLayers);
) but the problem appears when I'm trying to delete them becausethis.markerCluster.clearLayers();
does not remove the layers from the map and I have to do it manually:Isn't expected from
clearLayers
method to remove the layers also from the map?