[Pkg-javascript-commits] [leaflet-markercluster] 244/479: For animated zoomouts sometimes we'll zoom so that the previously visible bounds aren't fully contained within the new bounds, in those cases we need to remove the markers that were in the previous bounds but not the new bounds from the map as the normal animation won't take care of them. Fixes #63

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:35 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 1afb83b91da9d0a88701c4900f13079a1edc8883
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Sep 20 10:39:00 2012 +1200

    For animated zoomouts sometimes we'll zoom so that the previously visible bounds aren't fully contained within the new bounds, in those cases we need to remove the markers that were in the previous bounds but not the new bounds from the map as the normal animation won't take care of them. Fixes #63
---
 src/MarkerClusterGroup.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index be5fbb7..8286bc8 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -636,6 +636,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 
 		//Need to add markers for those that weren't on the map before but are now
 		this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
+		//Remove markers that were on the map before but won't be now
+		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds());
 	},
 	_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
 		var bounds = 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