Skip to content

Commit 6655441

Browse files
authored
fix(landing): Fix debug hillshade infinite loading. BM-1110 (#3360)
### Motivation Debug.hillshade keep loading network because the skip check with un-prefix hillshade sourceId and get the hillshade layer been removed and added for every rendering. ### Modifications Correct the check sourceId with prefixed one. ### Verification Tested with locally build, was infinite loading before fix, and only load once after fix.
1 parent 9fa3681 commit 6655441

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/landing/src/components/debug.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,12 @@ export class Debug extends Component<{ map: maplibregl.Map }, DebugState> {
335335
if (currentLayer) map.removeLayer(HillShadeLayerId);
336336
return;
337337
}
338-
if (currentLayer?.source === sourceId) return;
338+
339+
const hillShadeSourceId = `${HillShadePrefix}${sourceId}`;
340+
if (currentLayer?.source === hillShadeSourceId) return;
339341

340342
// Hillshading from an existing raster-dem source gives very mixed results and looks very blury
341343
// so add a new source layer to generate from
342-
const hillShadeSourceId = `${HillShadePrefix}${sourceId}`;
343344
const existingSource = map.getSource(hillShadeSourceId);
344345
if (existingSource == null) {
345346
const source = map.getSource(sourceId);

0 commit comments

Comments
 (0)