Align on-demand map context
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 21:45:57 +02:00
parent 8e38691251
commit 0718d0ebba
5 changed files with 41 additions and 13 deletions
+15 -11
View File
@@ -71,6 +71,7 @@ function App(): JSX.Element {
const [inspectorOpen, setInspectorOpen] = useState(false)
const [mapContentMode, setMapContentMode] = useState<'dataset' | 'analysis'>('dataset')
const [mapContextSourceLabel, setMapContextSourceLabel] = useState<string | null>(null)
const [mapContextLayerLabel, setMapContextLayerLabel] = useState<string | null>(null)
const workbenchMainRef = useRef<HTMLElement | null>(null)
useEffect(() => {
workbenchMainRef.current?.scrollTo({ top: 0, left: 0 })
@@ -710,17 +711,19 @@ function App(): JSX.Element {
: datasets.length > 0
? 'Kies een bron'
: 'Geen bron'
const layerContextLabel = bathymetryContextActive
? regionalBathymetryContextActive
? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten`
: `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen`
: mapFeatureCollection
? `${mapFeatureCount.toLocaleString('nl-BE')} objecten`
: viewportVectorLayerActive
? 'Kaartlaag gekozen'
: activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster'
? 'Rasterlaag actief'
: 'Geen actieve laag'
const layerContextLabel = activeWorkspace === 'map' && mapContextLayerLabel
? mapContextLayerLabel
: bathymetryContextActive
? regionalBathymetryContextActive
? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten`
: `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen`
: mapFeatureCollection
? `${mapFeatureCount.toLocaleString('nl-BE')} objecten`
: viewportVectorLayerActive
? 'Kaartlaag gekozen'
: activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster'
? 'Rasterlaag actief'
: 'Geen actieve laag'
return (
<div className="app-shell workbench-shell">
@@ -952,6 +955,7 @@ function App(): JSX.Element {
selectedFeature={selectedMapFeature}
onSelectMapArea={setSelectedMapAreaId}
onSetContextSourceLabel={setMapContextSourceLabel}
onSetContextLayerLabel={setMapContextLayerLabel}
onOpenDatasetInMap={openDatasetInMap}
onSetAreaLayerVisible={setAreaLayerVisible}
onSetAreaLayerOpacity={setAreaLayerOpacity}
@@ -543,6 +543,7 @@ interface MapWorkspaceProps {
selectedMapDatasetId: string
onSelectMapArea: (areaId: string) => void
onSetContextSourceLabel: (label: string | null) => void
onSetContextLayerLabel: (label: string | null) => void
onOpenDatasetInMap: (dataset: DatasetCreateResponse) => void
onSetAreaLayerVisible: (visible: boolean) => void
onSetAreaLayerOpacity: (opacity: number) => void
@@ -628,6 +629,7 @@ export function MapWorkspace({
selectedMapDatasetId,
onSelectMapArea,
onSetContextSourceLabel,
onSetContextLayerLabel,
onOpenDatasetInMap,
onSetAreaLayerVisible,
onSetAreaLayerOpacity,
@@ -1035,6 +1037,23 @@ export function MapWorkspace({
const activeResultDataset = activeThemeInsight?.dataset ?? activeThemeDataset
const activeSelectionResult = activeThemeInsight?.result
?? (!regionalPartitionedThemeActive && selectedMapDataset?.id === activeThemeDataset?.id ? mapSelectionResult : null)
useEffect(() => {
const contextLayerLabel = analysisMode === 'current' && activeOnDemandMapProduct
? activeSelectionResult
? `${(
activeSelectionResult.total_feature_count
?? activeSelectionResult.feature_count
).toLocaleString('nl-BE')} objecten gemeten`
: 'Op aanvraag'
: null
onSetContextLayerLabel(contextLayerLabel)
return () => onSetContextLayerLabel(null)
}, [
activeOnDemandMapProduct,
activeSelectionResult,
analysisMode,
onSetContextLayerLabel,
])
const explorerMapFeatureCollection = regionalBathymetryThemeActive
? null
: analysisMode === 'evolution' && temporalComparison?.geojson.features.length