Align on-demand map context
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user