commit16
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
import InteractiveInvestmentMap, {
|
||||
type InvestmentMapArea,
|
||||
type InvestmentMapFeature,
|
||||
type InvestmentMapKind,
|
||||
} from './interactive-investment-map';
|
||||
import { TerritoryGeometryDetails } from './territory-geometry-preview';
|
||||
import { useTerritoryGeometry } from './use-territory-geometry';
|
||||
const noAreas: InvestmentMapArea[] = [];
|
||||
|
||||
export default function CatalogueInvestmentMap({
|
||||
points,
|
||||
areas = noAreas,
|
||||
territoryId,
|
||||
mapKind,
|
||||
}: {
|
||||
points: InvestmentMapFeature[] | null;
|
||||
areas?: InvestmentMapArea[];
|
||||
territoryId?: string;
|
||||
mapKind?: InvestmentMapKind;
|
||||
}) {
|
||||
const { context, error } = useTerritoryGeometry(territoryId);
|
||||
return (
|
||||
<InteractiveInvestmentMap
|
||||
points={points}
|
||||
areas={areas}
|
||||
administrativeAreas={context?.areas}
|
||||
layerControls
|
||||
mapKind={mapKind}
|
||||
administrativeInfo={
|
||||
territoryId ? (
|
||||
<TerritoryGeometryDetails
|
||||
context={context}
|
||||
error={error}
|
||||
showSources={false}
|
||||
/>
|
||||
) : undefined
|
||||
}
|
||||
notice={
|
||||
territoryId ? (
|
||||
<>
|
||||
{error && (
|
||||
<p role="alert">
|
||||
{error} Os restantes dados do mapa continuam
|
||||
disponíveis.
|
||||
</p>
|
||||
)}
|
||||
{!context && !error && (
|
||||
<p role="status">
|
||||
A carregar limites administrativos…
|
||||
</p>
|
||||
)}
|
||||
{context && !context.selected_geometry_available && (
|
||||
<p role="note">
|
||||
Sem limite administrativo acessível para o
|
||||
território seleccionado.
|
||||
{context.areas.length > 0
|
||||
? ' Os limites de níveis superiores são apenas contexto e não representam a selecção.'
|
||||
: ''}
|
||||
</p>
|
||||
)}
|
||||
{context?.truncated && (
|
||||
<p role="alert">
|
||||
Cobertura administrativa incompleta: são
|
||||
apresentados até 100 limites.
|
||||
</p>
|
||||
)}
|
||||
</>
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user