Revert "Handle empty source tiles and queue them properly"

This reverts commit 818bdc411c.
This commit is contained in:
Andreas Hocevar
2019-09-27 16:09:27 +02:00
parent a47025b9c9
commit 76af2b6466
2 changed files with 5 additions and 9 deletions
+3 -5
View File
@@ -112,12 +112,10 @@ class TileQueue extends PriorityQueue {
if (state === TileState.ABORT) { if (state === TileState.ABORT) {
abortedTiles = true; abortedTiles = true;
} else if (state === TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) { } else if (state === TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
this.tilesLoadingKeys_[tileKey] = true;
++this.tilesLoading_;
++newLoads;
tile.load(); tile.load();
if (tile.getState() === TileState.LOADING) {
this.tilesLoadingKeys_[tileKey] = true;
++this.tilesLoading_;
++newLoads;
}
} }
} }
if (newLoads === 0 && abortedTiles) { if (newLoads === 0 && abortedTiles) {
+2 -4
View File
@@ -236,17 +236,15 @@ class VectorTile extends UrlTile {
empty = false; empty = false;
sourceTile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this)); sourceTile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this));
sourceTile.load(); sourceTile.load();
} else {
sourceTile = null;
} }
} else { } else {
empty = false; empty = false;
} }
covered = false; covered = false;
if (sourceTile === undefined) { if (!sourceTile) {
return; return;
} }
if (sourceTile !== null && tile.getState() === TileState.IDLE) { if (sourceTile.getState() !== TileState.EMPTY && tile.getState() === TileState.IDLE) {
tile.loadingSourceTiles++; tile.loadingSourceTiles++;
const key = listen(sourceTile, EventType.CHANGE, function() { const key = listen(sourceTile, EventType.CHANGE, function() {
const state = sourceTile.getState(); const state = sourceTile.getState();