fix: query persisted work area geometry
This commit is contained in:
@@ -28,7 +28,7 @@ export function useMapSelectionExtract({
|
||||
setMapSelectionError(null)
|
||||
}, [selectedProjectId, selectedDataset?.id])
|
||||
|
||||
const runMapSelectionExtract = async (bbox: VectorSelectionBBox) => {
|
||||
const runMapSelectionExtract = async (bbox: VectorSelectionBBox, areaId?: string) => {
|
||||
if (!selectedProjectId || !selectedDataset) {
|
||||
setMapSelectionError('Open a vector dataset before extracting a map area.')
|
||||
return null
|
||||
@@ -44,6 +44,7 @@ export function useMapSelectionExtract({
|
||||
try {
|
||||
const response = await datasetsApi.selectVectorFeatures(selectedProjectId, selectedDataset.id, {
|
||||
bbox: { ...bbox, crs: 'EPSG:4326' },
|
||||
area_id: areaId,
|
||||
limit: 1000,
|
||||
})
|
||||
setMapSelectionResult(response)
|
||||
|
||||
@@ -32,6 +32,7 @@ export function useMapThemeSelectionInsights<TThemeId extends string>(
|
||||
const loadThemeInsights = async (
|
||||
bbox: VectorSelectionBBox,
|
||||
queries: Array<MapThemeQuery<TThemeId>>,
|
||||
areaId?: string,
|
||||
): Promise<Array<MapThemeInsight<TThemeId>>> => {
|
||||
if (!selectedProjectId) {
|
||||
setThemeInsights([])
|
||||
@@ -48,6 +49,7 @@ export function useMapThemeSelectionInsights<TThemeId extends string>(
|
||||
dataset,
|
||||
result: await datasetsApi.selectVectorFeatures(selectedProjectId, dataset.id, {
|
||||
bbox,
|
||||
area_id: areaId,
|
||||
limit: 1000,
|
||||
}),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user