[Pkg-javascript-commits] [leaflet-markercluster] 49/479: Removing commented out bits etc

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:08 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 6766b1a875d03e7ca99f1a11e2231b649f44afcf
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 19 13:23:47 2012 +1200

    Removing commented out bits etc
---
 src/MarkerCluster.js      |  2 ++
 src/MarkerClusterGroup.js | 35 ++---------------------------------
 2 files changed, 4 insertions(+), 33 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index a5037ac..b67610a 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -295,6 +295,8 @@ L.MarkerCluster = L.Marker.extend({
 		var childClusters = this._childClusters,
 			i, c;
 
+		//TODO: When zooming down we need to generate new clusters for levels that don't have them yet
+
 		if (depthToStartAt > 0) { //Still going down to required depth, just recurse to child clusters
 			for (i = childClusters.length - 1; i >= 0; i--) {
 				c = childClusters[i];
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 910db6d..754ec84 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -421,25 +421,10 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		    depthToAnimateIn = previousZoomLevel - newZoomLevel;
 
 		console.log('animationZoomOut ' + depthToStartAt + ' ' + depthToAnimateIn);
+
 		//Animate all of the markers in the clusters to move to their cluster center point
-		//bounds, depthToStartAt, depthToAnimateIn
 		this._topClusterLevel._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, depthToStartAt, depthToAnimateIn);
-		/*for ( i = 0; i < newClusters.length; i++) {
-			var c = newClusters[i];
-
-			c._recursivelyAnimateChildrenIn(this._map.latLngToLayerPoint(c.getLatLng()).round(), depth);
-
-			if (bounds.contains(c._latlng)) { //Add the new cluster but have it be hidden (so it gets animated, display=none stops transition)
 
-				if (c._isSingleParent()) { //If we are the same as our parent, don't do an animation, just immediately appear
-					c.setOpacity(1);
-					c._recursivelyRemoveChildrenFromMap(depth);
-				} else {
-					c.setOpacity(0);
-				}
-				c._addToMap();
-			}
-		}*/
 		this._inZoomAnimation++;
 
 		var me = this;
@@ -447,30 +432,14 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//Immediately fire an event to update the opacity (If we immediately set it they won't animate)
 		setTimeout(function () {
 			me._topClusterLevel._recursivelyBecomeVisible(bounds, depthToStartAt);
-			/*for (i = 0; i < newClusters.length; i++) {
-				var n = newClusters[i];
-
-				if (n._icon) {
-					n.setOpacity(1);
-				}
-			}*/
 		}, 0);
 
 		//TODO: Maybe use the transition timing stuff to make this more reliable
+		//When the animations are done, tidy up
 		setTimeout(function () {
 
 			map._mapPane.className = map._mapPane.className.replace(' leaflet-cluster-anim', '');
 			me._topClusterLevel._recursivelyRemoveChildrenAndAddNowVisibleMarkers(bounds, depthToStartAt, depthToAnimateIn);
-			/*for (i = 0; i < newClusters.length; i++) {
-				var cl = newClusters[i];
-				cl._recursivelyRemoveChildrenFromMap(depth);
-			}
-			for (i = newUnclustered.length - 1; i >= 0; i--) {
-				var m = newUnclustered[i];
-				if (bounds.contains(m._latlng)) {
-					L.FeatureGroup.prototype.addLayer.call(me, m);
-				}
-			}*/
 			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