Fix reloading tiles in case of an error with tile.load()

This commit is contained in:
Andreas Hocevar
2022-07-21 23:18:31 +02:00
parent 1c68d5093d
commit a1d68b4f66
7 changed files with 97 additions and 10 deletions
+6 -1
View File
@@ -142,7 +142,12 @@ class Tile extends EventTarget {
/**
* Called by the tile cache when the tile is removed from the cache due to expiry
*/
release() {}
release() {
if (this.state === TileState.ERROR) {
// to remove the `change` listener on this tile in `ol/TileQueue#handleTileChange`
this.setState(TileState.EMPTY);
}
}
/**
* @return {string} Key.