Handle empty source tiles and queue them properly

This commit is contained in:
Andreas Hocevar
2019-09-24 15:18:59 +02:00
parent 3992aede9d
commit 818bdc411c
2 changed files with 9 additions and 5 deletions

View File

@@ -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();