From a0df0e3db3e1cc9f0de2972d1b96f0db2e57ee87 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 12 Sep 2012 11:17:03 +1200 Subject: [PATCH] Work around browsers without zoomAnimation not firing zoomstart. Makes spiderfied packs disappear on zoomout --- src/MarkerCluster.Spiderfier.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js index 28b1f0508..f1b87c566 100644 --- a/src/MarkerCluster.Spiderfier.js +++ b/src/MarkerCluster.Spiderfier.js @@ -309,7 +309,13 @@ L.MarkerClusterGroup.include({ _spiderfierOnAdd: function () { this._map.on('click', this._unspiderfyWrapper, this); - this._map.on('zoomstart', this._unspiderfyZoomStart, this); + + if (map.options.zoomAnimation) { + this._map.on('zoomstart', this._unspiderfyZoomStart, this); + } else { + //Browsers without zoomAnimation don't fire zoomstart + this._map.on('zoomend', this._unspiderfyWrapper, this); + } if (L.Browser.svg && !L.Browser.touch) { this._map._initPathRoot();