Initiate tile load only after registering it as loading

This commit is contained in:
Petr Sloup
2015-12-26 10:49:21 +01:00
parent dad58ba622
commit e1712eb44a

View File

@@ -119,10 +119,10 @@ ol.TileQueue.prototype.loadMoreTiles = function(maxTotalLoading, maxNewLoads) {
this.getCount() > 0) { this.getCount() > 0) {
tile = /** @type {ol.Tile} */ (this.dequeue()[0]); tile = /** @type {ol.Tile} */ (this.dequeue()[0]);
if (tile.getState() === ol.TileState.IDLE) { if (tile.getState() === ol.TileState.IDLE) {
tile.load();
this.tilesLoadingKeys_[tile.getKey()] = true; this.tilesLoadingKeys_[tile.getKey()] = true;
++this.tilesLoading_; ++this.tilesLoading_;
++newLoads; ++newLoads;
tile.load();
} }
} }
}; };