Work around browsers without zoomAnimation not firing zoomstart. Makes spiderfied packs disappear on zoomout

This commit is contained in:
danzel
2012-09-12 11:17:03 +12:00
parent 07a11582d3
commit a0df0e3db3
+7 -1
View File
@@ -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();