[Pkg-javascript-commits] [leaflet-markercluster] 288/479: Handle removeLayers([]) where some elements aren't in the MarkerClusterGroup

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit 9fb345543a1fbc53bc3e811504c6ff4d8f40e170
Author: danzel <danzel at localhost.geek.nz>
Date:   Wed Nov 14 09:58:22 2012 +1300

    Handle removeLayers([]) where some elements aren't in the MarkerClusterGroup
---
 src/MarkerClusterGroup.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index e6635b8..b631968 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -156,6 +156,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		for (i = 0, l = layersArray.length; i < l; i++) {
 			m = layersArray[i];
+
+			if (!m.__parent) {
+				continue;
+			}
+
 			this._removeLayer(m, true, true);
 
 			if (m._icon) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git



More information about the Pkg-javascript-commits mailing list