Align on-demand map context
This commit is contained in:
+3
-1
@@ -23,7 +23,9 @@
|
||||
- Prevented a single bounded municipality Dataset from being presented as
|
||||
complete Flanders coverage; GRB cards remain `Op aanvraag` until the active
|
||||
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
|
||||
configured while keeping the old generic import/fetch contract non-fetching
|
||||
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 "result[product.key] = null" 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 "geo.api.vlaanderen.be" not in workspace
|
||||
|
||||
@@ -10246,7 +10246,8 @@ Implemented:
|
||||
acquired small Mol Dataset no longer makes a complete-Flanders theme card
|
||||
appear fully loaded. In the Flanders workspace GRB stays `Op aanvraag`;
|
||||
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:
|
||||
- Focused provider, acquisition, route-envelope and frontend contract tests
|
||||
|
||||
@@ -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,7 +711,9 @@ function App(): JSX.Element {
|
||||
: datasets.length > 0
|
||||
? 'Kies een bron'
|
||||
: 'Geen bron'
|
||||
const layerContextLabel = bathymetryContextActive
|
||||
const layerContextLabel = activeWorkspace === 'map' && mapContextLayerLabel
|
||||
? mapContextLayerLabel
|
||||
: bathymetryContextActive
|
||||
? regionalBathymetryContextActive
|
||||
? `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen · ${regionalBathymetryPartitions.length} gemeenten`
|
||||
: `${bathymetryProfileCount.toLocaleString('nl-BE')} profielen`
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user