fix clearing tile background on zoom

This commit is contained in:
Mourner 2011-05-16 17:45:35 +03:00
parent c6ddf37eb2
commit 2f4e81ab3a

View File

@ -350,6 +350,7 @@ L.Map = L.Class.extend({
this._initialTopLeftPoint._add(offset);
}
this._tileLayersToLoad = this._tileLayersNum;
this.fire('viewreset');
this.fire('move');
@ -432,6 +433,7 @@ L.Map = L.Class.extend({
// clear scaled tiles after all new tiles are loaded (for performance)
this._tileLayersToLoad--;
if (this._tileLayersNum && !this._tileLayersToLoad && this._tileBg) {
console.log(this._tileLayersToLoad, this._tileLayersNum, 'clear');
clearTimeout(this._clearTileBgTimer);
this._clearTileBgTimer = setTimeout(L.Util.bind(this._clearTileBg, this), 500);
}