From ef4227dcd2122f63aaa3491d5b1e65a633a3b837 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 24 Apr 2013 10:08:20 +1200 Subject: [PATCH] Make this work on old leaflet too. Thanks @nkovacs --- src/MarkerCluster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js index bd2a7f30a..073f94546 100644 --- a/src/MarkerCluster.js +++ b/src/MarkerCluster.js @@ -272,7 +272,7 @@ L.MarkerCluster = L.Marker.extend({ for (i = c._childClusters.length - 1; i >= 0; i--) { m = c._childClusters[i]; if (!exceptBounds || !exceptBounds.contains(m._latlng)) { - if (L.FeatureGroup.prototype.hasLayer.call(c._group, m)) { + if (!L.FeatureGroup.prototype.hasLayer || L.FeatureGroup.prototype.hasLayer.call(c._group, m)) { L.FeatureGroup.prototype.removeLayer.call(c._group, m); } m.setOpacity(1);