fix(map): isolate bounded raster selections
This commit is contained in:
@@ -78,6 +78,10 @@ describe('map workspace selection guards', () => {
|
||||
geometry_clipped_to_selection: true,
|
||||
bbox_epsg4326: [4.55, 50.58, 4.56, 50.59],
|
||||
})).toBe(true)
|
||||
expect(isSelectionBoundedDataset({
|
||||
coverage_scope: 'bounded_selection',
|
||||
bbox_epsg4326: [5.1, 51.17, 5.11, 51.18],
|
||||
})).toBe(true)
|
||||
expect(isSelectionBoundedDataset({
|
||||
geometry_clipped_to_selection: false,
|
||||
bbox_epsg4326: [2.5, 49.5, 6.4, 51.6],
|
||||
|
||||
@@ -43,7 +43,9 @@ export function productCoversZones(productZones: string[], selectedZones: string
|
||||
export function isSelectionBoundedDataset(
|
||||
sourceMetadata: Record<string, unknown> | null | undefined,
|
||||
): boolean {
|
||||
return sourceMetadata?.['geometry_clipped_to_selection'] === true
|
||||
const boundedScope = sourceMetadata?.['geometry_clipped_to_selection'] === true
|
||||
|| sourceMetadata?.['coverage_scope'] === 'bounded_selection'
|
||||
return boundedScope
|
||||
&& Array.isArray(sourceMetadata?.['bbox_epsg4326'])
|
||||
&& sourceMetadata['bbox_epsg4326'].length === 4
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user