Use Map#stop to stop all animations

This commit is contained in:
John Firebaugh 2014-03-19 16:42:04 -07:00 committed by Vladimir Agafonkin
parent a071f489a5
commit a34810cb85
3 changed files with 3 additions and 9 deletions

View File

@ -10,9 +10,7 @@ L.Map.include({
center = this._limitCenter(L.latLng(center), zoom, this.options.maxBounds);
options = options || {};
if (this._panAnim) {
this._panAnim.stop();
}
this.stop();
if (this._loaded && !options.reset && options !== true) {

View File

@ -48,9 +48,7 @@ L.Map.Drag = L.Handler.extend({
},
_onDown: function () {
if (this._map._panAnim) {
this._map._panAnim.stop();
}
this._map.stop();
},
_onDragStart: function () {

View File

@ -33,9 +33,7 @@ L.Map.TouchZoom = L.Handler.extend({
this._centerOffset = viewCenter.subtract(this._startCenter);
if (map._panAnim) {
map._panAnim.stop();
}
map.stop();
L.DomEvent
.on(document, 'touchmove', this._onTouchMove, this)