[Pkg-javascript-commits] [leaflet-markercluster] 117/479: Fix up spiderfier breaking animation counting

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:17 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 d0d883c56b44dcf3a96ee57a4393b0242bea5d01
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 26 11:44:37 2012 +1200

    Fix up spiderfier breaking animation counting
---
 src/MarkerCluster.Spiderfier.js | 1 +
 src/MarkerClusterGroup.js       | 8 ++------
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js
index d993ff3..74da499 100644
--- a/src/MarkerCluster.Spiderfier.js
+++ b/src/MarkerCluster.Spiderfier.js
@@ -261,6 +261,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 				map.removeLayer(m._spiderLeg);
 				delete m._spiderLeg;
 			}
+			group._animationEnd();
 		}, 250);
 	}
 });
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 88ac08d..8040c25 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -152,7 +152,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 	},
 
 	_moveEnd: function () {
-		if (this._inZoomAnimation > 0) {
+		if (this._inZoomAnimation) {
 			return;
 		}
 
@@ -343,6 +343,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 	//Animated versions here
 	_animationStart: function () {
 		this._map._mapPane.className += ' leaflet-cluster-anim';
+		this._inZoomAnimation++;
 	},
 	_animationEnd: function () {
 		this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
@@ -402,8 +403,6 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 			c._recursivelyRestoreChildPositions(depthToDescend);
 		});
 
-		this._inZoomAnimation++;
-
 		//Remove the old clusters and close the zoom animation
 		
 		setTimeout(function () {
@@ -431,8 +430,6 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//Animate all of the markers in the clusters to move to their cluster center point
 		marker._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, depthToStartAt, depthToAnimateIn);
 
-		this._inZoomAnimation++;
-
 		var me = this;
 
 		//Update the opacity (If we immediately set it they won't animate)
@@ -486,6 +483,5 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//Could loop all this._layers and do this for each _icon if it stops working
 
 		L.Util.falseFn(document.body.offsetWidth);
-
 	}
 });
\ No newline at end of file

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