[Pkg-javascript-commits] [leaflet-markercluster] 467/479: Fix some cases where zoomToShowLayer wouldn't work. Fixes #286 #228 #203

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:01: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 f0b1618e0700bba1dc3d951417c7debfb440b931
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Dec 19 16:03:55 2013 +1300

    Fix some cases where zoomToShowLayer wouldn't work. Fixes #286 #228 #203
---
 src/MarkerClusterGroup.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 8d3502a..7f8f0fb 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -378,14 +378,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			}
 		};
 
-		if (layer._icon) {
+		if (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {
 			callback();
 		} else if (layer.__parent._zoom < this._map.getZoom()) {
 			//Layer should be visible now but isn't on screen, just pan over to it
 			this._map.on('moveend', showMarker, this);
-			if (!layer._icon) {
-				this._map.panTo(layer.getLatLng());
-			}
+			this._map.panTo(layer.getLatLng());
 		} else {
 			this._map.on('moveend', showMarker, this);
 			this.on('animationend', showMarker, this);

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