Render error tiles as empty

This commit is contained in:
Tom Payne
2013-04-25 14:49:55 +02:00
parent e7eb07197e
commit d8a4b19b54

View File

@@ -279,11 +279,11 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
tile = tileSource.getTile(z, x, y, projection);
tileState = tile.getState();
if (tileState == ol.TileState.LOADED || tileState == ol.TileState.EMPTY) {
if (tileState == ol.TileState.LOADED ||
tileState == ol.TileState.EMPTY ||
tileState == ol.TileState.ERROR) {
tilesToDrawByZ[z][tile.tileCoord.toString()] = tile;
continue;
} else if (tileState == ol.TileState.ERROR) {
continue;
}
allTilesLoaded = false;
@@ -335,7 +335,9 @@ ol.renderer.canvas.TileLayer.prototype.renderFrame =
x = tileSize.width * (tile.tileCoord.x - canvasTileRange.minX);
y = tileSize.height * (canvasTileRange.maxY - tile.tileCoord.y);
tileState = tile.getState();
if (tileState == ol.TileState.EMPTY || !opaque) {
if (tileState == ol.TileState.EMPTY ||
tileState == ol.TileState.ERROR ||
!opaque) {
context.clearRect(x, y, tileSize.width, tileSize.height);
}
if (tileState == ol.TileState.LOADED) {