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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user