From 17186c36f74bbc7de8aaca87ab6b09cbc0c0eaa9 Mon Sep 17 00:00:00 2001 From: danzel Date: Thu, 19 Jul 2012 13:35:54 +1200 Subject: [PATCH] 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 754ec84d4..7b4f8d80d 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()); } } : {