[Pkg-javascript-commits] [leaflet-markercluster] 51/479: Get non animated versions going again

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 17186c36f74bbc7de8aaca87ab6b09cbc0c0eaa9
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Jul 19 13:35:54 2012 +1200

    Get non animated versions going again
---
 src/MarkerClusterGroup.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 754ec84..7b4f8d8 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -94,8 +94,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		console.log('generating initial topCluster ' + this._map.getZoom());
 		var res = this._topClusterLevel = this._clusterToMarkerCluster([], [], this._needsClustering, this._map.getZoom());
 
-		//Remember the current zoom level
+		//Remember the current zoom level and bounds
 		this._zoom = this._map._zoom;
+		this._currentShownBounds = this._getExpandedVisibleBounds();
 
 		//Make things appear on the map
 		res._recursivelyAddChildrenToMap(null, 1, this._getExpandedVisibleBounds());
@@ -343,11 +344,11 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 		//Do nothing...
 	},
 	_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
-		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel - this._topClusterLevel._zoom + 1);
+		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel - this._topClusterLevel._zoom);
 		this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds());
 	},
 	_animationZoomOut: function (previousZoomLevel, newZoomLevel) {
-		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel - this._topClusterLevel._zoom + 1);
+		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel - this._topClusterLevel._zoom);
 		this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds());
 	}
 } : {

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