added check for noMoveStart option in map.flyTo (#5923)
* added check for noMoveStart option in map.flyTo * added implicit false parameter to _moveStart when noMoveStart option is not set * Shorten option check * Fix typo :(
This commit is contained in:
parent
d6739c20c1
commit
4c0c3acdd6
@ -426,7 +426,7 @@ export var Map = Evented.extend({
|
||||
}
|
||||
}
|
||||
|
||||
this._moveStart(true);
|
||||
this._moveStart(true, options.noMoveStart);
|
||||
|
||||
frame.call(this);
|
||||
return this;
|
||||
@ -1143,7 +1143,7 @@ export var Map = Evented.extend({
|
||||
|
||||
var zoomChanged = this._zoom !== zoom;
|
||||
this
|
||||
._moveStart(zoomChanged)
|
||||
._moveStart(zoomChanged, false)
|
||||
._move(center, zoom)
|
||||
._moveEnd(zoomChanged);
|
||||
|
||||
@ -1160,7 +1160,7 @@ export var Map = Evented.extend({
|
||||
}
|
||||
},
|
||||
|
||||
_moveStart: function (zoomChanged) {
|
||||
_moveStart: function (zoomChanged, noMoveStart) {
|
||||
// @event zoomstart: Event
|
||||
// Fired when the map zoom is about to change (e.g. before zoom animation).
|
||||
// @event movestart: Event
|
||||
@ -1168,7 +1168,10 @@ export var Map = Evented.extend({
|
||||
if (zoomChanged) {
|
||||
this.fire('zoomstart');
|
||||
}
|
||||
return this.fire('movestart');
|
||||
if (!noMoveStart) {
|
||||
this.fire('movestart');
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_move: function (center, zoom, data) {
|
||||
@ -1601,7 +1604,7 @@ export var Map = Evented.extend({
|
||||
|
||||
Util.requestAnimFrame(function () {
|
||||
this
|
||||
._moveStart(true)
|
||||
._moveStart(true, false)
|
||||
._animateZoom(center, zoom, true);
|
||||
}, this);
|
||||
|
||||
|
@ -91,7 +91,7 @@ export var TouchZoom = Handler.extend({
|
||||
}
|
||||
|
||||
if (!this._moved) {
|
||||
map._moveStart(true);
|
||||
map._moveStart(true, false);
|
||||
this._moved = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user