Merge pull request #9978 from ahocevar/tilequeue-loading
Handle empty source tiles and queue them properly
This commit is contained in:
@@ -112,10 +112,12 @@ class TileQueue extends PriorityQueue {
|
||||
if (state === TileState.ABORT) {
|
||||
abortedTiles = true;
|
||||
} else if (state === TileState.IDLE && !(tileKey in this.tilesLoadingKeys_)) {
|
||||
this.tilesLoadingKeys_[tileKey] = true;
|
||||
++this.tilesLoading_;
|
||||
++newLoads;
|
||||
tile.load();
|
||||
if (tile.getState() === TileState.LOADING) {
|
||||
this.tilesLoadingKeys_[tileKey] = true;
|
||||
++this.tilesLoading_;
|
||||
++newLoads;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newLoads === 0 && abortedTiles) {
|
||||
|
||||
@@ -236,15 +236,17 @@ class VectorTile extends UrlTile {
|
||||
empty = false;
|
||||
sourceTile.addEventListener(EventType.CHANGE, this.handleTileChange.bind(this));
|
||||
sourceTile.load();
|
||||
} else {
|
||||
sourceTile = null;
|
||||
}
|
||||
} else {
|
||||
empty = false;
|
||||
}
|
||||
covered = false;
|
||||
if (!sourceTile) {
|
||||
if (sourceTile === undefined) {
|
||||
return;
|
||||
}
|
||||
if (sourceTile.getState() !== TileState.EMPTY && tile.getState() === TileState.IDLE) {
|
||||
if (sourceTile !== null && tile.getState() === TileState.IDLE) {
|
||||
tile.loadingSourceTiles++;
|
||||
const key = listen(sourceTile, EventType.CHANGE, function() {
|
||||
const state = sourceTile.getState();
|
||||
|
||||
Reference in New Issue
Block a user