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
+3 -1
View File
@@ -23,7 +23,9 @@
- Prevented a single bounded municipality Dataset from being presented as - Prevented a single bounded municipality Dataset from being presented as
complete Flanders coverage; GRB cards remain `Op aanvraag` until the active complete Flanders coverage; GRB cards remain `Op aanvraag` until the active
selection has produced its measured result, and stale previously opened selection has produced its measured result, and stale previously opened
vector features are not rendered behind an on-demand theme. vector features are not rendered behind an on-demand theme. The global
context bar also reports `Op aanvraag` instead of the previous Dataset's
feature count.
- Updated the provider registry to report the bounded GRB integration as - Updated the provider registry to report the bounded GRB integration as
configured while keeping the old generic import/fetch contract non-fetching configured while keeping the old generic import/fetch contract non-fetching
and directing callers to the governed project endpoint. and directing callers to the governed project endpoint.
@@ -390,5 +390,7 @@ def test_grb_frontend_and_contracts_use_only_the_governed_backend_path() -> None
assert "officialMapProducts.grb" in workspace assert "officialMapProducts.grb" in workspace
assert "result[product.key] = null" in workspace assert "result[product.key] = null" in workspace
assert ": onDemandThemeActive\n ? null\n : mapFeatureCollection" in workspace assert ": onDemandThemeActive\n ? null\n : mapFeatureCollection" in workspace
assert "onSetContextLayerLabel" in workspace
assert "'Op aanvraag'" in workspace
assert "/datasets/grb/acquire" in contracts assert "/datasets/grb/acquire" in contracts
assert "geo.api.vlaanderen.be" not in workspace assert "geo.api.vlaanderen.be" not in workspace
+2 -1
View File
@@ -10246,7 +10246,8 @@ Implemented:
acquired small Mol Dataset no longer makes a complete-Flanders theme card acquired small Mol Dataset no longer makes a complete-Flanders theme card
appear fully loaded. In the Flanders workspace GRB stays `Op aanvraag`; appear fully loaded. In the Flanders workspace GRB stays `Op aanvraag`;
the exact bounded result is shown only after selection and an older active the exact bounded result is shown only after selection and an older active
vector layer is not rendered behind it. vector layer is not rendered behind it. The top-level map context follows
the same state and cannot retain an unrelated Dataset count.
Validation: Validation:
- Focused provider, acquisition, route-envelope and frontend contract tests - Focused provider, acquisition, route-envelope and frontend contract tests
+15 -11
View File
@@ -71,6 +71,7 @@ function App(): JSX.Element {
const [inspectorOpen, setInspectorOpen] = useState(false) const [inspectorOpen, setInspectorOpen] = useState(false)
const [mapContentMode, setMapContentMode] = useState<'dataset' | 'analysis'>('dataset') const [mapContentMode, setMapContentMode] = useState<'dataset' | 'analysis'>('dataset')
const [mapContextSourceLabel, setMapContextSourceLabel] = useState<string | null>(null) const [mapContextSourceLabel, setMapContextSourceLabel] = useState<string | null>(null)
const [mapContextLayerLabel, setMapContextLayerLabel] = useState<string | null>(null)
const workbenchMainRef = useRef<HTMLElement | null>(null) const workbenchMainRef = useRef<HTMLElement | null>(null)
useEffect(() => { useEffect(() => {
workbenchMainRef.current?.scrollTo({ top: 0, left: 0 }) workbenchMainRef.current?.scrollTo({ top: 0, left: 0 })
@@ -710,17 +711,19 @@ function App(): JSX.Element {
: datasets.length > 0 : datasets.length > 0
? 'Kies een bron' ? 'Kies een bron'
: 'Geen bron' : 'Geen bron'
const layerContextLabel = bathymetryContextActive const layerContextLabel = activeWorkspace === 'map' && mapContextLayerLabel
? regionalBathymetryContextActive ? mapContextLayerLabel
? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten` : bathymetryContextActive
: `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen` ? regionalBathymetryContextActive
: mapFeatureCollection ? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten`
? `${mapFeatureCount.toLocaleString('nl-BE')} objecten` : `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen`
: viewportVectorLayerActive : mapFeatureCollection
? 'Kaartlaag gekozen' ? `${mapFeatureCount.toLocaleString('nl-BE')} objecten`
: activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster' : viewportVectorLayerActive
? 'Rasterlaag actief' ? 'Kaartlaag gekozen'
: 'Geen actieve laag' : activeWorkspace === 'map' && selectedDataset?.dataset_type === 'raster'
? 'Rasterlaag actief'
: 'Geen actieve laag'
return ( return (
<div className="app-shell workbench-shell"> <div className="app-shell workbench-shell">
@@ -952,6 +955,7 @@ function App(): JSX.Element {
selectedFeature={selectedMapFeature} selectedFeature={selectedMapFeature}
onSelectMapArea={setSelectedMapAreaId} onSelectMapArea={setSelectedMapAreaId}
onSetContextSourceLabel={setMapContextSourceLabel} onSetContextSourceLabel={setMapContextSourceLabel}
onSetContextLayerLabel={setMapContextLayerLabel}
onOpenDatasetInMap={openDatasetInMap} onOpenDatasetInMap={openDatasetInMap}
onSetAreaLayerVisible={setAreaLayerVisible} onSetAreaLayerVisible={setAreaLayerVisible}
onSetAreaLayerOpacity={setAreaLayerOpacity} onSetAreaLayerOpacity={setAreaLayerOpacity}
@@ -543,6 +543,7 @@ interface MapWorkspaceProps {
selectedMapDatasetId: string selectedMapDatasetId: string
onSelectMapArea: (areaId: string) => void onSelectMapArea: (areaId: string) => void
onSetContextSourceLabel: (label: string | null) => void onSetContextSourceLabel: (label: string | null) => void
onSetContextLayerLabel: (label: string | null) => void
onOpenDatasetInMap: (dataset: DatasetCreateResponse) => void onOpenDatasetInMap: (dataset: DatasetCreateResponse) => void
onSetAreaLayerVisible: (visible: boolean) => void onSetAreaLayerVisible: (visible: boolean) => void
onSetAreaLayerOpacity: (opacity: number) => void onSetAreaLayerOpacity: (opacity: number) => void
@@ -628,6 +629,7 @@ export function MapWorkspace({
selectedMapDatasetId, selectedMapDatasetId,
onSelectMapArea, onSelectMapArea,
onSetContextSourceLabel, onSetContextSourceLabel,
onSetContextLayerLabel,
onOpenDatasetInMap, onOpenDatasetInMap,
onSetAreaLayerVisible, onSetAreaLayerVisible,
onSetAreaLayerOpacity, onSetAreaLayerOpacity,
@@ -1035,6 +1037,23 @@ export function MapWorkspace({
const activeResultDataset = activeThemeInsight?.dataset ?? activeThemeDataset const activeResultDataset = activeThemeInsight?.dataset ?? activeThemeDataset
const activeSelectionResult = activeThemeInsight?.result const activeSelectionResult = activeThemeInsight?.result
?? (!regionalPartitionedThemeActive && selectedMapDataset?.id === activeThemeDataset?.id ? mapSelectionResult : null) ?? (!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 const explorerMapFeatureCollection = regionalBathymetryThemeActive
? null ? null
: analysisMode === 'evolution' && temporalComparison?.geojson.features.length : analysisMode === 'evolution' && temporalComparison?.geojson.features.length