further improve event listener performance

This commit is contained in:
vcoppe committed 2026-02-01 15:57:18 +01:00
1 parent 0ab3b77db8
commit 9895c3c304
5 files changed
+114 -59

No files matched your search

+3
View File
@@ -157,6 +157,9 @@ export class StyleManager {
const terrain = this.getCurrentTerrain();
if (JSON.stringify(mapTerrain) !== JSON.stringify(terrain)) {
if (terrain.exaggeration > 0) {
if (!map_.getSource(terrain.source)) {
map_.addSource(terrain.source, terrainSources[terrain.source]);
}
map_.setTerrain(terrain);
} else {
map_.setTerrain(null);