prevent extra movestart on inertia drag

This commit is contained in:
oslek 2013-02-13 13:35:40 -08:00
parent f7301fa267
commit c3ccf01a29
2 changed files with 5 additions and 3 deletions

View File

@ -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');

View File

@ -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);
});
}