fix(runtime): serialize deploys and clarify regional sources
This commit is contained in:
@@ -96,6 +96,7 @@ interface OnDemandMapProduct extends MapThemeAcquisition {
|
||||
availabilityLabel: string
|
||||
attribution: string
|
||||
limitationMessage: string
|
||||
coverageZones: string[]
|
||||
}
|
||||
|
||||
interface PlannedOnDemandMapProduct extends OnDemandMapProduct {
|
||||
@@ -1051,6 +1052,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: `${product.native_resolution_m} m · ${product.observation_year} · automatisch bij selectie`,
|
||||
attribution: product.attribution,
|
||||
limitationMessage: product.limitation_message,
|
||||
coverageZones: ['flanders'],
|
||||
})
|
||||
}
|
||||
for (const product of officialMapProducts.grb) {
|
||||
@@ -1062,6 +1064,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: 'officiële vectorbron · automatisch bij selectie',
|
||||
attribution: product.attribution,
|
||||
limitationMessage: product.limitation_message,
|
||||
coverageZones: ['flanders'],
|
||||
})
|
||||
}
|
||||
for (const source of officialMapProducts.bathymetry.filter(
|
||||
@@ -1078,6 +1081,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: 'historische profielpunten · automatisch bij selectie',
|
||||
attribution: source.attribution,
|
||||
limitationMessage: source.limitation_message,
|
||||
coverageZones: ['flanders'],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1092,6 +1096,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: `${product.observation_label} · officiële vectorbron · automatisch bij selectie`,
|
||||
attribution: product.attribution,
|
||||
limitationMessage: product.limitation_message,
|
||||
coverageZones: product.coverage_zones,
|
||||
})
|
||||
}
|
||||
const dhmvProduct = includesFlanders
|
||||
@@ -1106,6 +1111,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: `${dhmvProduct.native_resolution_m} m · ${dhmvProduct.acquisition_period} · automatisch bij selectie`,
|
||||
attribution: dhmvProduct.attribution,
|
||||
limitationMessage: dhmvProduct.limitation_message,
|
||||
coverageZones: ['flanders'],
|
||||
})
|
||||
}
|
||||
const floodProduct = includesFlanders
|
||||
@@ -1122,6 +1128,7 @@ export function MapWorkspace({
|
||||
availabilityLabel: `${floodProduct.native_resolution_m} m · ${floodProduct.climate_context} · T${floodProduct.return_period_years} · automatisch bij selectie`,
|
||||
attribution: floodProduct.attribution,
|
||||
limitationMessage: floodProduct.limitation_message,
|
||||
coverageZones: ['flanders'],
|
||||
})
|
||||
}
|
||||
return result
|
||||
@@ -1134,8 +1141,34 @@ export function MapWorkspace({
|
||||
])
|
||||
const onDemandProductMap = useMemo(() => {
|
||||
const result = new Map<DataThemeId, OnDemandMapProduct>()
|
||||
const productsByTheme = new Map<DataThemeId, OnDemandMapProduct[]>()
|
||||
for (const product of onDemandProductsForZones(selectedCoverageZones)) {
|
||||
result.set(product.theme, product)
|
||||
productsByTheme.set(product.theme, [...(productsByTheme.get(product.theme) ?? []), product])
|
||||
}
|
||||
for (const [theme, products] of productsByTheme) {
|
||||
if (products.length === 1) {
|
||||
const product = products[0]
|
||||
const scopeZones = product.coverageZones.filter((zone) => selectedCoverageZones?.includes(zone) ?? true)
|
||||
result.set(theme, selectedCoverageZones && selectedCoverageZones.length > 1
|
||||
? {
|
||||
...product,
|
||||
availabilityLabel: `${product.availabilityLabel} · alleen ${scopeZones.map(coverageZoneLabel).join(', ')}`,
|
||||
}
|
||||
: product)
|
||||
continue
|
||||
}
|
||||
const coverageZones = Array.from(new Set(
|
||||
products.flatMap((product) => product.coverageZones)
|
||||
.filter((zone) => selectedCoverageZones?.includes(zone) ?? true),
|
||||
))
|
||||
result.set(theme, {
|
||||
...products[0],
|
||||
displayName: 'Officiële bron per regio',
|
||||
availabilityLabel: `${coverageZones.map(coverageZoneLabel).join(', ')} · bron wordt na selectie bepaald`,
|
||||
attribution: 'Officiële Belgische en gewestelijke databronnen',
|
||||
limitationMessage: 'GeoIntel bepaalt na de getekende selectie welke regionale bron van toepassing is en voegt alleen semantisch gelijkwaardige resultaten samen.',
|
||||
coverageZones,
|
||||
})
|
||||
}
|
||||
return result
|
||||
}, [onDemandProductsForZones, selectedCoverageZones])
|
||||
|
||||
Reference in New Issue
Block a user