preserve visual center of map on sidebar transitions

This commit is contained in:
John Firebaugh 2013-11-08 16:49:46 -08:00
parent a805e0b545
commit 1082d3a653
4 changed files with 21 additions and 13 deletions

View file

@ -1773,11 +1773,7 @@ L.Map = L.Class.extend({
this._rawPanBy(offset);
}
this.fire('move');
// make sure moveend is not fired too often on resize
clearTimeout(this._sizeTimer);
this._sizeTimer = setTimeout(L.bind(this.fire, this, 'moveend'), 200);
this.fire('move').fire('moveend');
}
return this.fire('resize', {