[Pkg-javascript-commits] [leaflet-markercluster] 43/479: Fix up zoom out not always removing child clusters.

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:07 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 3f668910bfa3c19a1b8b3d9e22537b31e266d6e8
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 19 10:56:18 2012 +1200

    Fix up zoom out not always removing child clusters.
---
 src/MarkerCluster.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index ec8b97c..027b913 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -127,8 +127,8 @@ L.MarkerCluster = L.Marker.extend({
 			markers = this._markers,
 			i;
 
-		if (depthToStartAt == 0) {
-			this._recursivelyRemoveChildrenFromMap(depthToAnimateIn);
+		if (depthToStartAt === 0) {
+			this._recursivelyRemoveChildrenFromMap(bounds, depthToAnimateIn); //TODO: previousBounds, not bounds
 
 		} else {
 			for (i = childClusters.length - 1; i >= 0; i--) {
@@ -191,9 +191,10 @@ L.MarkerCluster = L.Marker.extend({
 			if (bounds.contains(this._latlng)) { //Add the new cluster but have it be hidden (so it gets animated, display=none stops transition)
 
 				//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.
-				if (this._isSingleParent() && depthToAnimateIn == 1) { //If we are the same as our parent, don't do an animation, just immediately appear
+				if (this._isSingleParent() && depthToAnimateIn === 1) { //If we are the same as our parent, don't do an animation, just immediately appear
 					this.setOpacity(1);
-					this._recursivelyRemoveChildrenFromMap(depthToAnimateIn); //Immediately 
+					this._recursivelyRemoveChildrenFromMap(depthToAnimateIn); //Immediately remove our children as we are replacing them
+					console.log('skipping');
 				} else {
 					this.setOpacity(0);
 				}
@@ -294,7 +295,7 @@ L.MarkerCluster = L.Marker.extend({
 			m.setOpacity(1);
 		}
 
-		if (depth === 1) {
+		if (depth === 0) {
 			//child clusters
 			for (var j = 0; j < this._childClusters.length; j++) {
 				m = this._childClusters[j];

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