fix: export active map theme results
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-14 13:38:27 +02:00
parent 50e7d0163b
commit 0ec1ab4970
4 changed files with 17 additions and 2 deletions
+1
View File
@@ -16,6 +16,7 @@
- Made the official full Mol municipality area and the largest authoritative building layer the initial map context.
- Added an idempotent operator provisioner for official Mol GRB roads, water and parcels through the existing API/DatasetService/PostGIS persistence flow.
- Prevented stale asynchronous dataset-detail responses from replacing the latest selected map layer and its visible context.
- Kept GeoJSON download/copy actions attached to the active theme result when switching themes after a rectangle analysis.
## Sprint 185 Coverage-aware Mol operational benchmark (2026-07-14)
@@ -24,6 +24,8 @@ def test_map_first_explorer_is_the_default_product_flow() -> None:
assert "useMapThemeSelectionInsights" in workspace
assert "datasetsApi.selectVectorFeatures" in read("frontend/src/hooks/useMapThemeSelectionInsights.ts")
assert "activeSelectionResult" in workspace
assert "downloadActiveThemeSelection" in workspace
assert "disabled={!activeSelectionResult}" in workspace
assert "bboxesEqual(mapSelectionBbox, selectedAreaBbox)" in workspace
+1
View File
@@ -7761,6 +7761,7 @@ Validated:
- The official provisioner persisted 8,444 roads, 3,668 water features and 32,961 parcels alongside the existing 36,941 GRB buildings for the complete Mol municipality.
- In-app browser validation of `Volledige gemeente` reported 114.55 km2, 36,941 buildings and a building density of 322.5/km2; the bounded preview clearly reported 1,000 of 36,941 features.
- Dataset-detail loading now ignores stale asynchronous responses, preventing a slower municipality-boundary request from overwriting the currently selected building layer or its map context.
- Theme switching reuses the same analyzed rectangle and keeps GeoJSON download/copy actions bound to the active theme result instead of a stale technical dataset selection.
Limitations:
- Population and forest/green remain unavailable rather than simulated until suitable authoritative sources and semantics are selected.
+13 -2
View File
@@ -604,6 +604,17 @@ export function MapWorkspace({
copyText(JSON.stringify(mapSelectionResult?.geojson ?? { type: 'FeatureCollection', features: [] }, null, 2))
}
const downloadActiveThemeSelection = () => {
if (!activeSelectionResult) {
return
}
downloadJsonFile(`${activeTheme.id}-selection.geojson`, activeSelectionResult.geojson)
}
const copyActiveThemeSelection = () => {
copyText(JSON.stringify(activeSelectionResult?.geojson ?? { type: 'FeatureCollection', features: [] }, null, 2))
}
const saveAreaSelectionExport = () => {
const bbox = parseBboxInput(bboxInput)
if (!bbox) {
@@ -961,8 +972,8 @@ export function MapWorkspace({
) : null}
<div className="geo-result-actions">
<button className="secondary-action" disabled={!mapSelectionResult} type="button" onClick={downloadAreaSelection}>Download GeoJSON</button>
<button className="secondary-action" disabled={!mapSelectionResult} type="button" onClick={copyAreaSelection}>Kopieer gegevens</button>
<button className="secondary-action" disabled={!activeSelectionResult} type="button" onClick={downloadActiveThemeSelection}>Download GeoJSON</button>
<button className="secondary-action" disabled={!activeSelectionResult} type="button" onClick={copyActiveThemeSelection}>Kopieer gegevens</button>
</div>
</>
)}