fix(map): bound overview feature payloads
This commit is contained in:
@@ -27,6 +27,7 @@ export interface MapThemeQuery<TThemeId extends string> {
|
||||
partitioned?: boolean
|
||||
acquisition?: MapThemeAcquisition
|
||||
acquisitionBboxes?: VectorSelectionBBox[]
|
||||
featureLimit?: number
|
||||
}
|
||||
|
||||
export interface MapThemeInsight<TThemeId extends string> {
|
||||
@@ -104,9 +105,10 @@ export function useMapThemeSelectionInsights<TThemeId extends string>(
|
||||
const settled = await settleWithConcurrency(
|
||||
queries,
|
||||
3,
|
||||
async ({ themeId, dataset: existingDataset, partitioned, acquisition, acquisitionBboxes }) => {
|
||||
async ({ themeId, dataset: existingDataset, partitioned, acquisition, acquisitionBboxes, featureLimit }) => {
|
||||
let dataset = existingDataset
|
||||
let acquiredDatasets: DatasetCreateResponse[] = []
|
||||
const resultLimit = featureLimit ?? 1000
|
||||
if (acquisition) {
|
||||
const requestedBboxes = acquisitionBboxes?.length ? acquisitionBboxes : [bbox]
|
||||
const acquisitionResults = await settleWithConcurrency(requestedBboxes, 1, async (acquisitionBbox) => {
|
||||
@@ -209,18 +211,18 @@ export function useMapThemeSelectionInsights<TThemeId extends string>(
|
||||
dataset_ids: acquiredDatasetIds,
|
||||
bbox,
|
||||
area_id: areaId,
|
||||
limit: 1000,
|
||||
limit: resultLimit,
|
||||
})
|
||||
: dataset.source_name === 'vmm_vha_bathymetry_profiles' && partitioned
|
||||
? await datasetsApi.selectBathymetryProfilePartitions(selectedProjectId, {
|
||||
bbox,
|
||||
area_id: areaId,
|
||||
limit: 1000,
|
||||
limit: resultLimit,
|
||||
})
|
||||
: await datasetsApi.selectVectorFeatures(selectedProjectId, dataset.id, {
|
||||
bbox,
|
||||
area_id: areaId,
|
||||
limit: 1000,
|
||||
limit: resultLimit,
|
||||
}),
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user