Add one-click GIS workflow run
This commit is contained in:
@@ -28,11 +28,11 @@ export function useMapSelectionExtract({
|
||||
const runMapSelectionExtract = async (bbox: VectorSelectionBBox) => {
|
||||
if (!selectedProjectId || !selectedDataset) {
|
||||
setMapSelectionError('Open a vector dataset before extracting a map area.')
|
||||
return
|
||||
return null
|
||||
}
|
||||
if (!isVectorDatasetType(selectedDataset.dataset_type)) {
|
||||
setMapSelectionError('Area extraction requires an active vector dataset.')
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
setMapSelectionLoading(true)
|
||||
@@ -44,9 +44,11 @@ export function useMapSelectionExtract({
|
||||
limit: 250,
|
||||
})
|
||||
setMapSelectionResult(response)
|
||||
return response
|
||||
} catch (error) {
|
||||
setMapSelectionResult(null)
|
||||
setMapSelectionError(formatError(error, 'Area extraction failed'))
|
||||
return null
|
||||
} finally {
|
||||
setMapSelectionLoading(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user