prevent false move events in invalidateSize

This commit is contained in:
oslek 2013-02-13 12:38:33 -08:00
parent 52f61bf55a
commit 2c11fdfa6d

View File

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