[Pkg-javascript-commits] [leaflet-markercluster] 193/219: Update MarkerClusterGroup.js

Jonas Smedegaard dr at jones.dk
Sat May 7 09:39:34 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit ed9f02e6a4c0df377142e8837b62763e96fa8ef0
Author: Serg <saleks at scanex.ru>
Date:   Sat Nov 28 18:04:25 2015 +0300

    Update MarkerClusterGroup.js
    
    Use this._maxZoom instead map.getMaxZoom() in _zoomOrSpiderfy.
    When we use disableClusteringAtZoom in options this._maxZoom not equal map.options.maxZoom.
---
 src/MarkerClusterGroup.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index f4a5228..c64b5d4 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -709,16 +709,15 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 	},
 
 	_zoomOrSpiderfy: function (e) {
-		var map = this._map,
-		    cluster = e.layer,
+		var cluster = e.layer,
 		    bottomCluster = cluster;
 
 		while (bottomCluster._childClusters.length === 1) {
 			bottomCluster = bottomCluster._childClusters[0];
 		}
 
-		if (bottomCluster._zoom === map.getMaxZoom() && bottomCluster._childCount === cluster._childCount) {
-			// All child markers are contained in a single cluster from map._maxZoom to this cluster.
+		if (bottomCluster._zoom === this._maxZoom && bottomCluster._childCount === cluster._childCount) {
+			// All child markers are contained in a single cluster from this._maxZoom to this cluster.
 			if (this.options.spiderfyOnMaxZoom) {
 				cluster.spiderfy();
 			}
@@ -728,7 +727,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		// Focus the map again for keyboard users.
 		if (e.originalEvent && e.originalEvent.keyCode === 13) {
-			map._container.focus();
+			this._map._container.focus();
 		}
 	},
 

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