Fix up spiderfier breaking animation counting

This commit is contained in:
danzel
2012-07-26 11:44:37 +12:00
parent f07e684405
commit d0d883c56b
2 changed files with 3 additions and 6 deletions
+1
View File
@@ -261,6 +261,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
group._animationEnd();
}, 250);
}
});
+2 -6
View File
@@ -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);
}
});