This example tests the behavior of removing GeoJSON markers while a cluster is spiderfied. Click a cluster to spiderfy it, then use the buttons to remove individual markers.
// Create GeoJSON layers
let m = new L.GeoJSON(geoJsonFeature, {
pointToLayer: function (feature, latlng) {
return new L.Marker(latlng);
}
});
markers.addLayer(m);
// Remove specific marker
markers.removeLayer(markersList[0]);
Test Scenario:
Interactive Controls:
Expected behavior: When a cluster is spiderfied and you remove one marker, the remaining marker should stay visible and correctly positioned.