diff --git a/example/old-bugs/remove-when-spiderfied.html b/example/old-bugs/remove-when-spiderfied.html index c72155dbd..6c674b5d7 100644 --- a/example/old-bugs/remove-when-spiderfied.html +++ b/example/old-bugs/remove-when-spiderfied.html @@ -21,9 +21,11 @@
-
+
Bug #54. Spiderfy the cluster then click the button. Should result in 2 markers right beside each other on the map.
Bug #53. Spiderfy the cluster then click the button. Spider lines remain on the map. + Bug #49. Spiderfy the cluster then click the second button. Spider lines remain on the map. Click the map to get an error. + diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 702abfd38..a1a2b15bc 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -103,6 +103,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ clearLayers: function () { //Need our own special implementation as the LayerGroup one doesn't work for us + if (this._unspiderfy) { + this._unspiderfy(); + } + //If we aren't on the map yet, just blow away the markers we know of if (!this._map) { this._needsClustering = [];