diff --git a/src/map/anim/Map.PanAnimation.js b/src/map/anim/Map.PanAnimation.js index c1bd3077..0b140eeb 100644 --- a/src/map/anim/Map.PanAnimation.js +++ b/src/map/anim/Map.PanAnimation.js @@ -32,7 +32,7 @@ L.Map.include({ return this; }, - panBy: function (offset, duration, easeLinearity) { + panBy: function (offset, duration, easeLinearity, moving) { offset = L.point(offset); if (!(offset.x || offset.y)) { @@ -48,7 +48,9 @@ L.Map.include({ }, this); } - this.fire('movestart'); + if (moving !== true) { + this.fire('movestart'); + } L.DomUtil.addClass(this._mapPane, 'leaflet-pan-anim'); diff --git a/src/map/handler/Map.Drag.js b/src/map/handler/Map.Drag.js index 65cf0041..323ee927 100644 --- a/src/map/handler/Map.Drag.js +++ b/src/map/handler/Map.Drag.js @@ -132,7 +132,7 @@ L.Map.Drag = L.Handler.extend({ offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); L.Util.requestAnimFrame(function () { - map.panBy(offset, decelerationDuration, ease); + map.panBy(offset, decelerationDuration, ease, true); }); }