Only track tiles that are actually wanted

Instead of keeping track of wanted tile ranges, we can instead track wanted tiles individually.  This provides enough for the map to know how to prioritize tiles and should be more efficient (no extra calls to extend tile ranges or check for tile containment within a range).
This commit is contained in:
Tim Schaub
2013-02-06 16:08:24 -07:00
parent e335b7b74a
commit 2bd29ff60e
6 changed files with 13 additions and 21 deletions

View File

@@ -131,6 +131,7 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
tileState = tile.getState();
if (tileState == ol.TileState.IDLE) {
this.updateWantedTiles(frameState.wantedTiles, tileSource, tileCoord);
tileCenter = tileGrid.getTileCoordCenter(tileCoord);
frameState.tileQueue.enqueue(tile, tileSourceKey, tileCenter);
} else if (tileState == ol.TileState.LOADED) {
@@ -234,7 +235,6 @@ ol.renderer.dom.TileLayer.prototype.renderFrame =
if (!allTilesLoaded) {
frameState.animate = true;
this.updateWantedTiles(frameState.wantedTiles, tileSource, z, tileRange);
}
this.updateUsedTiles(frameState.usedTiles, tileSource, z, tileRange);