update inertia settings

This commit is contained in:
Vladimir Agafonkin 2014-07-30 17:37:38 +03:00
parent 468e195ba1
commit 7a75d07d89

View File

@ -9,7 +9,7 @@ L.Map.mergeOptions({
inertiaDeceleration: 3400, // px/s^2 inertiaDeceleration: 3400, // px/s^2
inertiaMaxSpeed: Infinity, // px/s inertiaMaxSpeed: Infinity, // px/s
inertiaThreshold: L.Browser.touch ? 32 : 18, // ms inertiaThreshold: L.Browser.touch ? 32 : 18, // ms
easeLinearity: 0.25, easeLinearity: 0.2,
// TODO refactor, move to CRS // TODO refactor, move to CRS
worldCopyJump: false worldCopyJump: false
@ -72,7 +72,7 @@ L.Map.Drag = L.Handler.extend({
this._positions.push(pos); this._positions.push(pos);
this._times.push(time); this._times.push(time);
if (time - this._times[0] > 200) { if (time - this._times[0] > 100) {
this._positions.shift(); this._positions.shift();
this._times.shift(); this._times.shift();
} }
@ -141,7 +141,8 @@ L.Map.Drag = L.Handler.extend({
map.panBy(offset, { map.panBy(offset, {
duration: decelerationDuration, duration: decelerationDuration,
easeLinearity: ease, easeLinearity: ease,
noMoveStart: true noMoveStart: true,
animate: true
}); });
}); });
} }