prevent extra movestart on inertia drag
This commit is contained in:
parent
f7301fa267
commit
c3ccf01a29
@ -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');
|
||||
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user