Skip to content

Commit

Permalink
Updating tiles only when adding new terrain (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
SnailBones authored Jan 10, 2024
1 parent ebd9875 commit 624ba14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,8 @@ export class Map extends Camera {
// add terrain
const sourceCache = this.style.sourceCaches[options.source];
if (!sourceCache) throw new Error(`cannot load terrain, because there exists no source with ID: ${options.source}`);
sourceCache.reload();
// Update terrain tiles when adding new terrain
if (this.terrain === null) sourceCache.reload();
// Warn once if user is using the same source for hillshade and terrain
for (const index in this.style._layers) {
const thisLayer = this.style._layers[index];
Expand Down

0 comments on commit 624ba14

Please sign in to comment.