[Pkg-javascript-commits] [leaflet-markercluster] 231/479: Fix up bounds recalculation, previously if you removed a marker the bounds wouldn't change

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:34 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 5128c9c9195dd59b7ee9b5d6841b70b3d7f34c67
Author: danzel <danzel at localhost.geek.nz>
Date:   Wed Sep 12 17:49:48 2012 +1200

    Fix up bounds recalculation, previously if you removed a marker the bounds wouldn't change
---
 src/MarkerCluster.js | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js
index 904e455..fe5fad3 100644
--- a/src/MarkerCluster.js
+++ b/src/MarkerCluster.js
@@ -316,18 +316,13 @@ L.MarkerCluster = L.Marker.extend({
 			i;
 
 		this._bounds = new L.LatLngBounds();
+		delete this._wLatLng;
 
 		for (i = markers.length - 1; i >= 0; i--) {
-			this._bounds.extend(markers[i].getLatLng());
+			this._expandBounds(markers[i]);
 		}
 		for (i = childClusters.length - 1; i >= 0; i--) {
-			this._bounds.extend(childClusters[i]._bounds);
-		}
-
-		if (this._childCount === 0) {
-			delete this._latlng;
-		} else {
-			this.setLatLng(this._wLatLng);
+			this._expandBounds(childClusters[i]);
 		}
 	},
 

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