feat: add public resource and infrastructure evidence layers to catalogue map
This commit is contained in:
@@ -15,7 +15,9 @@ import OpportunityRelatedResults, {
|
||||
} from '@/components/opportunity-related-results';
|
||||
import { Link, router, useForm, usePage } from '@inertiajs/react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import Map from '@/components/catalogue-investment-map';
|
||||
import Map, {
|
||||
type ThematicMapRecord,
|
||||
} from '@/components/thematic-investment-map';
|
||||
import type { InvestmentMapArea } from '@/components/interactive-investment-map';
|
||||
import { type TerritoryOption } from '@/components/investment-territory';
|
||||
import { Frame, button, card, money, api } from './shared';
|
||||
@@ -178,6 +180,9 @@ export default function Catalogue({
|
||||
});
|
||||
}, [comparison, view]);
|
||||
const [points, setPoints] = useState<Feature[] | null>(null);
|
||||
const [thematicRecords, setThematicRecords] = useState<ThematicMapRecord[]>(
|
||||
[],
|
||||
);
|
||||
const [areas, setAreas] = useState<InvestmentMapArea[]>([]);
|
||||
const [unlocated, setUnlocated] = useState<
|
||||
{ id: number; title: string; location: string; url: string }[]
|
||||
@@ -320,6 +325,7 @@ export default function Catalogue({
|
||||
}
|
||||
setPoints(null);
|
||||
setAreas([]);
|
||||
setThematicRecords([]);
|
||||
setUnlocated([]);
|
||||
setMapContext([]);
|
||||
setTruncated(false);
|
||||
@@ -329,6 +335,7 @@ export default function Catalogue({
|
||||
if (active) {
|
||||
setPoints(data.features);
|
||||
setAreas(data.areas ?? []);
|
||||
setThematicRecords(data.thematic_records ?? []);
|
||||
setUnlocated(data.unlocated ?? []);
|
||||
setMapContext(data.territorial_context ?? []);
|
||||
setTruncated(Boolean(data.truncated));
|
||||
@@ -637,7 +644,7 @@ export default function Catalogue({
|
||||
) : points === null ? (
|
||||
'A carregar o mapa…'
|
||||
) : (
|
||||
`${points.length} ${points.length === 1 ? 'local' : 'locais'} no mapa; ${unlocated.length} ${unlocated.length === 1 ? 'oportunidade' : 'oportunidades'} sem coordenadas confirmadas.`
|
||||
`Na pesquisa: ${points.length} ${points.length === 1 ? 'local com coordenadas' : 'locais com coordenadas'}; ${unlocated.length} ${unlocated.length === 1 ? 'oportunidade' : 'oportunidades'} sem coordenadas confirmadas.`
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
@@ -647,6 +654,8 @@ export default function Catalogue({
|
||||
<Map
|
||||
points={error ? [] : points}
|
||||
areas={areas}
|
||||
records={thematicRecords}
|
||||
truncated={truncated}
|
||||
territoryId={
|
||||
String(
|
||||
filters.locality_id ||
|
||||
|
||||
Reference in New Issue
Block a user