Move State to ol.Tile

This commit is contained in:
Tim Schaub
2016-08-11 22:58:32 -06:00
parent ef468b3b06
commit 9e4d80b459
22 changed files with 126 additions and 131 deletions

View File

@@ -5,7 +5,7 @@ goog.provide('ol.renderer.webgl.TileLayer');
goog.require('ol.transform');
goog.require('ol.TileRange');
goog.require('ol.TileState');
goog.require('ol.Tile');
goog.require('ol.array');
goog.require('ol.extent');
goog.require('ol.math');
@@ -248,20 +248,20 @@ ol.renderer.webgl.TileLayer.prototype.prepareFrame = function(frameState, layerS
}
}
tileState = tile.getState();
drawable = tileState == ol.TileState.LOADED ||
tileState == ol.TileState.EMPTY ||
tileState == ol.TileState.ERROR && !useInterimTilesOnError;
drawable = tileState == ol.Tile.State.LOADED ||
tileState == ol.Tile.State.EMPTY ||
tileState == ol.Tile.State.ERROR && !useInterimTilesOnError;
if (!drawable && tile.interimTile) {
tile = tile.interimTile;
}
tileState = tile.getState();
if (tileState == ol.TileState.LOADED) {
if (tileState == ol.Tile.State.LOADED) {
if (mapRenderer.isTileTextureLoaded(tile)) {
tilesToDrawByZ[z][tile.tileCoord.toString()] = tile;
continue;
}
} else if (tileState == ol.TileState.EMPTY ||
(tileState == ol.TileState.ERROR &&
} else if (tileState == ol.Tile.State.EMPTY ||
(tileState == ol.Tile.State.ERROR &&
!useInterimTilesOnError)) {
continue;
}
@@ -328,7 +328,7 @@ ol.renderer.webgl.TileLayer.prototype.prepareFrame = function(frameState, layerS
* @param {ol.Tile} tile Tile.
*/
function(tile) {
if (tile.getState() == ol.TileState.LOADED &&
if (tile.getState() == ol.Tile.State.LOADED &&
!mapRenderer.isTileTextureLoaded(tile) &&
!tileTextureQueue.isKeyQueued(tile.getKey())) {
tileTextureQueue.enqueue([