From 63e43e430f1e6948d88b7ce79b9caf2dbe4b2262 Mon Sep 17 00:00:00 2001 From: danzel Date: Fri, 5 Jul 2013 12:03:20 +1200 Subject: [PATCH] Clear our internal cluster layer when we are removed from the map so those layers aren't there when we are re-added. Fixes #211 --- src/MarkerClusterGroup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index cc5a1b894..ac3f51d58 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -443,6 +443,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ this._featureGroup.onRemove(map); this._nonPointGroup.onRemove(map); + this._featureGroup.clearLayers(); + this._map = null; },