[Pkg-javascript-commits] [leaflet-markercluster] 27/479: Fade out old clusters on zoom in

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:05 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 d29edf7e73fec32e00eab80d02618f9fb23991f9
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Jul 17 15:09:34 2012 +1200

    Fade out old clusters on zoom in
---
 src/MarkerClusterGroup.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 14d8e00..4b18466 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -430,9 +430,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 			c = startingClusters[i];
 			startPos = c.getLatLng();
 
-			//Remove old cluster
-			L.FeatureGroup.prototype.removeLayer.call(this, c); //TODO Animate
-
+			//Fade out old cluster
+			c.setOpacity(0);
 			c._recursivelyAddChildrenToMap(startPos, depth, bounds);
 		}
 
@@ -465,6 +464,9 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 			}
 
 			setTimeout(function () {
+				for (i = 0; i < startingClusters.length; i++) {
+					L.FeatureGroup.prototype.removeLayer.call(me, startingClusters[i]);
+				}
 				map._mapPane.className = map._mapPane.className.replace(' leaflet-cluster-anim', '');
 				me._inZoomAnimation--;
 			}, 250);

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