From d5eaabb7edf62a8c03efa604520ca1dc007ddcf0 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Mon, 8 May 2023 14:46:08 +0300 Subject: [PATCH] Use map transform in case when source is not yet loaded on _preloadTiles --- src/source/source_cache.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/source/source_cache.js b/src/source/source_cache.js index a1afffb650c..f7d2dc41ce3 100644 --- a/src/source/source_cache.js +++ b/src/source/source_cache.js @@ -1020,9 +1020,10 @@ class SourceCache extends Evented { } const tileIDs = Array.from(coveringTilesIDs.values()); + const tileZoom = this.transform ? this.transform.tileZoom : this.map.transform.tileZoom; asyncAll(tileIDs, (tileID, done) => { - const tile = new Tile(tileID, this._source.tileSize * tileID.overscaleFactor(), this.transform.tileZoom, this.map.painter, this._isRaster); + const tile = new Tile(tileID, this._source.tileSize * tileID.overscaleFactor(), tileZoom, this.map.painter, this._isRaster); this._loadTile(tile, (err) => { if (this._source.type === 'raster-dem' && tile.dem) this._backfillDEM(tile); done(err, tile);