Only do Marker/Path zoom animation if options.zoomAnimation is on (Aka we are doing the zoom animation), be pointless otherwise ;)
This commit is contained in:
parent
df07bf0ae6
commit
106228647e
@ -25,7 +25,7 @@ L.Marker = L.Class.extend({
|
|||||||
|
|
||||||
map.on('viewreset', this._reset, this);
|
map.on('viewreset', this._reset, this);
|
||||||
|
|
||||||
if (L.Browser.any3d && map.options.animateMarkerZoom) {
|
if (map.options.zoomAnimation && map.options.animateMarkerZoom) {
|
||||||
map.on('zoomanim', this._zoomAnimation, this);
|
map.on('zoomanim', this._zoomAnimation, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ L.Map.include({
|
|||||||
this._pathRoot = L.Path.prototype._createElement('svg');
|
this._pathRoot = L.Path.prototype._createElement('svg');
|
||||||
this._panes.overlayPane.appendChild(this._pathRoot);
|
this._panes.overlayPane.appendChild(this._pathRoot);
|
||||||
|
|
||||||
if (L.Browser.any3d) {
|
if (this.options.zoomAnimation) {
|
||||||
this.on('zoomanim', this._animatePathZoom);
|
this.on('zoomanim', this._animatePathZoom);
|
||||||
this.on('zoomend', this._endPathZoom);
|
this.on('zoomend', this._endPathZoom);
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ L.Map.include((L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? {}
|
|||||||
|
|
||||||
this._panes.overlayPane.appendChild(root);
|
this._panes.overlayPane.appendChild(root);
|
||||||
|
|
||||||
if (L.Browser.any3d) {
|
if (this.options.zoomAnimation) {
|
||||||
this.on('zoomanim', this._animatePathZoom);
|
this.on('zoomanim', this._animatePathZoom);
|
||||||
this.on('zoomend', this._endZoom);
|
this.on('zoomend', this._endZoom);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user