From 8aa970fea0fb9d523762d5a1f41771f2c9c29c5f Mon Sep 17 00:00:00 2001 From: Wentao Kuang Date: Fri, 18 Oct 2024 14:30:40 +1300 Subject: [PATCH] Fix debug hillshade infinite loading. --- packages/landing/src/components/debug.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/landing/src/components/debug.tsx b/packages/landing/src/components/debug.tsx index d96414c92..ccf12784b 100644 --- a/packages/landing/src/components/debug.tsx +++ b/packages/landing/src/components/debug.tsx @@ -335,11 +335,12 @@ export class Debug extends Component<{ map: maplibregl.Map }, DebugState> { if (currentLayer) map.removeLayer(HillShadeLayerId); return; } - if (currentLayer?.source === sourceId) return; + + const hillShadeSourceId = `${HillShadePrefix}${sourceId}`; + if (currentLayer?.source === hillShadeSourceId) return; // Hillshading from an existing raster-dem source gives very mixed results and looks very blury // so add a new source layer to generate from - const hillShadeSourceId = `${HillShadePrefix}${sourceId}`; const existingSource = map.getSource(hillShadeSourceId); if (existingSource == null) { const source = map.getSource(sourceId);