Skip to content

Commit d9c1310

Browse files
committed
Merge pull request #609 from OriginalSin/OriginalSin-patch-1
Update MarkerClusterGroup.js
2 parents 5848031 + ed9f02e commit d9c1310

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/MarkerClusterGroup.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -709,16 +709,15 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
709709
},
710710

711711
_zoomOrSpiderfy: function (e) {
712-
var map = this._map,
713-
cluster = e.layer,
712+
var cluster = e.layer,
714713
bottomCluster = cluster;
715714

716715
while (bottomCluster._childClusters.length === 1) {
717716
bottomCluster = bottomCluster._childClusters[0];
718717
}
719718

720-
if (bottomCluster._zoom === map.getMaxZoom() && bottomCluster._childCount === cluster._childCount) {
721-
// All child markers are contained in a single cluster from map._maxZoom to this cluster.
719+
if (bottomCluster._zoom === this._maxZoom && bottomCluster._childCount === cluster._childCount) {
720+
// All child markers are contained in a single cluster from this._maxZoom to this cluster.
722721
if (this.options.spiderfyOnMaxZoom) {
723722
cluster.spiderfy();
724723
}
@@ -728,7 +727,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
728727

729728
// Focus the map again for keyboard users.
730729
if (e.originalEvent && e.originalEvent.keyCode === 13) {
731-
map._container.focus();
730+
this._map._container.focus();
732731
}
733732
},
734733

0 commit comments

Comments
 (0)