From 44319cf233b2b633c0da01d6e61e354156bf1bd6 Mon Sep 17 00:00:00 2001 From: mike-000 <49240900+mike-000@users.noreply.github.com> Date: Fri, 25 Jun 2021 12:42:49 +0100 Subject: [PATCH] handle synchronous loading correctly --- src/ol/reproj/Tile.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ol/reproj/Tile.js b/src/ol/reproj/Tile.js index 02fe5c75db..a44fcba169 100644 --- a/src/ol/reproj/Tile.js +++ b/src/ol/reproj/Tile.js @@ -334,15 +334,15 @@ class ReprojTile extends Tile { }.bind(this) ); - this.sourceTiles_.forEach(function (tile, i, arr) { - const state = tile.getState(); - if (state == TileState.IDLE) { - tile.load(); - } - }); - if (leftToLoad === 0) { setTimeout(this.reproject_.bind(this), 0); + } else { + this.sourceTiles_.forEach(function (tile, i, arr) { + const state = tile.getState(); + if (state == TileState.IDLE) { + tile.load(); + } + }); } } }