Skip to content

Commit 624ba14

Browse files
authored
Updating tiles only when adding new terrain (#3561)
1 parent ebd9875 commit 624ba14

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ui/map.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,8 @@ export class Map extends Camera {
19281928
// add terrain
19291929
const sourceCache = this.style.sourceCaches[options.source];
19301930
if (!sourceCache) throw new Error(`cannot load terrain, because there exists no source with ID: ${options.source}`);
1931-
sourceCache.reload();
1931+
// Update terrain tiles when adding new terrain
1932+
if (this.terrain === null) sourceCache.reload();
19321933
// Warn once if user is using the same source for hillshade and terrain
19331934
for (const index in this.style._layers) {
19341935
const thisLayer = this.style._layers[index];

0 commit comments

Comments
 (0)