[Pkg-javascript-commits] [leaflet-markercluster] 218/479: Make this a forwards loop so that a clear+re-add creates the same clusters

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:33 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 c001bfb5f6c0000d5e7ef063188f562538bc8291
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Sep 11 15:11:15 2012 +1200

    Make this a forwards loop so that a clear+re-add creates the same clusters
---
 src/MarkerClusterGroup.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 71eff4d..8160a81 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -227,7 +227,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			this._generateInitialClusters();
 		}
 
-		for (var i = this._needsClustering.length - 1; i >= 0; i--) {
+		for (var i = 0, l = this._needsClustering.length; i < l; i++) {
 			this._addLayer(this._needsClustering[i], this._maxZoom);
 		}
 		this._needsClustering = [];
@@ -417,7 +417,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 				var parent = closest.__cluster || this._topClusterLevel;
 
 				//Create new cluster with these 2 in it
-				console.log('creating new cluster with 2 markers at zoom ' + zoom);
 
 				var newCluster = new L.MarkerCluster(this, zoom, closest, layer);
 				gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));
@@ -451,7 +450,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 	//Merge and split any existing clusters that are too big or small
 	_mergeSplitClusters: function () {
-		console.log('mergesplit ' + this._zoom + ' -> ' + map._zoom);
 		if (this._zoom < this._map._zoom) { //Zoom in, split
 			this._animationStart();
 			//Remove clusters now off screen

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