Select usable Flanders theme by default
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-17 18:37:40 +02:00
parent ce597ee0b4
commit c28958d9c7
2 changed files with 36 additions and 0 deletions
@@ -790,6 +790,40 @@ export function MapWorkspace({
const onDemandThematicThemeActive = analysisMode === 'current' && Boolean(activeOnDemandThematicProduct)
const regionalOnDemandThematicThemeActive = regionalScopeSelected && onDemandThematicThemeActive
const activeThemeAvailable = Boolean(activeThemeDataset) || onDemandThematicThemeActive
useEffect(() => {
if (
!flandersScopeSelected
|| analysisMode !== 'current'
|| activeThemeAvailable
|| (onDemandThematicProductMap.size === 0 && !thematicRasterProductsError)
) {
return
}
const fallbackTheme = DATA_THEMES.find((theme) =>
theme.id === 'space_occupation'
&& Boolean(themeDatasetMap[theme.id] || onDemandThematicProductMap.get(theme.id)),
) ?? DATA_THEMES.find((theme) =>
Boolean(themeDatasetMap[theme.id] || onDemandThematicProductMap.get(theme.id)),
)
if (!fallbackTheme) {
return
}
setActiveThemeId(fallbackTheme.id)
const fallbackDataset = themeDatasetMap[fallbackTheme.id]
if (fallbackDataset) {
onOpenDatasetInMap(fallbackDataset)
}
}, [
activeThemeAvailable,
analysisMode,
flandersScopeSelected,
onDemandThematicProductMap,
onOpenDatasetInMap,
thematicRasterProductsError,
themeDatasetMap,
])
const terrainImageOverlays = useMemo(
() =>
activeTheme.id === 'elevation' && selectedProjectId