From 1cc375d324779e05752de04cc100a286abbc1f99 Mon Sep 17 00:00:00 2001 From: danzel Date: Thu, 11 Oct 2012 10:45:16 +1300 Subject: [PATCH] Make removeLayers when not on the map a bit less wasteful --- src/MarkerClusterGroup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index cdc3d5dd14..ac806653bb 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -154,7 +154,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ if (!this._map) { for (i = 0, l = layersArray.length; i < l; i++) { - this.removeLayer(layersArray[i]); + this._arraySplice(this._needsClustering, layersArray[i]); } return this; }