[Pkg-javascript-commits] [leaflet-markercluster] 44/479: Fix up some zoom out issues including when the icon doesn't change (100 -> 100)

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 7e75986edfff408c4a429703d114927e70d9f5c3
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 19 11:16:44 2012 +1200

    Fix up some zoom out issues including when the icon doesn't change (100 -> 100)
---
 src/MarkerCluster.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 027b913..b760110 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -193,8 +193,7 @@ L.MarkerCluster = L.Marker.extend({
 				//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
 					this.setOpacity(1);
-					this._recursivelyRemoveChildrenFromMap(depthToAnimateIn); //Immediately remove our children as we are replacing them
-					console.log('skipping');
+					this._recursivelyRemoveChildrenFromMap(bounds, depthToAnimateIn); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
 				} else {
 					this.setOpacity(0);
 				}
@@ -285,8 +284,9 @@ L.MarkerCluster = L.Marker.extend({
 		}
 	},
 
+	//depth 1 means I remove my immediate children from the map
 	_recursivelyRemoveChildrenFromMap: function (previousBounds, depth) {
-		//TODO: Use previousBounds so we only bother looking at ones that were on screen
+		//TODO: Use previousBounds so we only bother looking at ones that weren't on screen
 		var m;
 		//markers
 		for (var i = 0; i < this._markers.length; i++) {
@@ -295,7 +295,7 @@ L.MarkerCluster = L.Marker.extend({
 			m.setOpacity(1);
 		}
 
-		if (depth === 0) {
+		if (depth === 1) {
 			//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