mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00
prevent false move events in invalidateSize
This commit is contained in:
@ -211,15 +211,17 @@ L.Map = L.Class.extend({
|
||||
|
||||
var offset = oldSize._subtract(this.getSize())._divideBy(2)._round();
|
||||
|
||||
if (animate === true) {
|
||||
this.panBy(offset);
|
||||
} else {
|
||||
this._rawPanBy(offset);
|
||||
if ((offset.x !== 0) || (offset.y !== 0)) {
|
||||
if (animate === true) {
|
||||
this.panBy(offset);
|
||||
} else {
|
||||
this._rawPanBy(offset);
|
||||
|
||||
this.fire('move');
|
||||
this.fire('move');
|
||||
|
||||
clearTimeout(this._sizeTimer);
|
||||
this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200);
|
||||
clearTimeout(this._sizeTimer);
|
||||
this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
Reference in New Issue
Block a user