From e86afca04ad72e727ac4718da46bcbb88f865614 Mon Sep 17 00:00:00 2001 From: danzel Date: Thu, 6 Dec 2012 13:42:27 +1300 Subject: [PATCH] Fix clearLayers not unsetting __parent of the markers, preventing them from being re-added. Fixes #99 --- src/MarkerClusterGroup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 7d2dd19ef..ed8d2c68b 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -209,6 +209,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ } } + this.eachLayer(function (marker) { + delete marker.__parent; + }); + if (this._map) { //Reset _topClusterLevel and the DistanceGrids this._generateInitialClusters();