Merge pull request #538 from giscloud/inertia.few.fixes
Inertia.few.fixes
This commit is contained in:
commit
667964bad1
@ -96,8 +96,8 @@ L.Transition = L.Transition.extend({
|
||||
this._el.style[L.Transition.PROPERTY] = 'none';
|
||||
|
||||
this.fire('step');
|
||||
|
||||
if (e instanceof window.Event) {
|
||||
|
||||
if (e instanceof Object) {
|
||||
this.fire('end');
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +91,8 @@ L.Map.Drag = L.Handler.extend({
|
||||
options = map.options,
|
||||
delay = +new Date() - this._lastTime;
|
||||
|
||||
if (!options.inertia || delay > options.inertiaThreshold) {
|
||||
map
|
||||
.fire('moveend')
|
||||
.fire('dragend');
|
||||
|
||||
if (!options.inertia || delay > options.inertiaThreshold || this._positions[0] === undefined) {
|
||||
map.fire('moveend');
|
||||
} else {
|
||||
|
||||
var direction = this._lastPos.subtract(this._positions[0]),
|
||||
@ -125,6 +122,7 @@ L.Map.Drag = L.Handler.extend({
|
||||
L.Util.requestAnimFrame(this._panInsideMaxBounds, map, true, map._container);
|
||||
}
|
||||
}
|
||||
map.fire('dragend');
|
||||
},
|
||||
|
||||
_panInsideMaxBounds: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user