[Pkg-javascript-commits] [leaflet-markercluster] 215/479: Working on removeLayer, works so long as no cluster ever needs removing

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:32 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 761d2657324e88b533b8b1a4e464346146cedb03
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Sep 11 11:28:14 2012 +1200

    Working on removeLayer, works so long as no cluster ever needs removing
---
 src/MarkerCluster.js      | 3 ++-
 src/MarkerClusterGroup.js | 7 +------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 5763f3a..5eb9c42 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -91,7 +91,7 @@ L.MarkerCluster = L.Marker.extend({
 
 	_removeChildMarker: function (marker) {
 		var markers = this._markers,
-		    group = this._group, i;
+			i;
 
 		for (i = markers.length - 1; i >= 0; i--) {
 			if (markers[i] === marker) {
@@ -101,6 +101,7 @@ L.MarkerCluster = L.Marker.extend({
 				while (p) {
 					p._childCount--;
 					p._recalculateBounds();
+					p._updateIcon();
 					p = p._parent;
 				}
 				return true;
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 2fabc92..1762762 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -103,12 +103,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			this._unspiderfyLayer(layer);
 		}
 
-		if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) {
-			//If this happens you are doing something bad
-			//If you've moved a marker that is in the cluster then that would be why
-			//console.log('failed to remove');
-			var a = 0;
-		}
+		layer.__cluster._removeChildMarker(layer);
 
 		return this;
 	},

-- 
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