[Pkg-javascript-commits] [leaflet-markercluster] 53/479: Fix _recursivelyRemoveChildrenAndAddNowVisibleMarkers

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

    Fix _recursivelyRemoveChildrenAndAddNowVisibleMarkers
---
 src/MarkerCluster.js | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 24b6ad7..351de28 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -122,30 +122,9 @@ L.MarkerCluster = L.Marker.extend({
 	},
 
 	_recursivelyRemoveChildrenAndAddNowVisibleMarkers: function (bounds, depthToStartAt, depthToAnimateIn) {
-		//TODO: Care more about bounds?
-		var childClusters = this._childClusters,
-			markers = this._markers,
-			i;
-
-		if (depthToStartAt === 0) {
-			this._recursivelyRemoveChildrenFromMap(bounds, depthToAnimateIn); //TODO: previousBounds, not bounds
-
-		} else {
-			for (i = childClusters.length - 1; i >= 0; i--) {
-				if (bounds.intersects(childClusters[i]._bounds)) {
-					childClusters[i]._recursivelyRemoveChildrenAndAddNowVisibleMarkers(bounds, depthToStartAt - 1, depthToAnimateIn - 1);
-				}
-			}
-
-			if (depthToStartAt == 1) {
-				for (i = markers.length - 1; i >= 0; i--) {
-					var m = markers[i];
-					if (bounds.contains(m._latlng)) {
-						L.FeatureGroup.prototype.addLayer.call(this._group, m);
-					}
-				}
-			}
-		}
+		this._recursively(bounds, depthToStartAt, 0, null, function (c) {
+			c._recursivelyRemoveChildrenFromMap(bounds, depthToAnimateIn - 1);
+		});
 	},
 
 	_recursivelyAnimateChildrenIn: function (bounds, center, depth) {

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