From 1e6e70c2e85a43c743c1229279361eaa7e708636 Mon Sep 17 00:00:00 2001 From: Sandra Hoang Date: Tue, 18 Nov 2025 11:36:25 -0500 Subject: [PATCH 1/2] check if bbox is a list of lists --- src/layers/map.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layers/map.tsx b/src/layers/map.tsx index 67f6539..5c15898 100644 --- a/src/layers/map.tsx +++ b/src/layers/map.tsx @@ -263,8 +263,10 @@ function valueToGeoJson(value: StacValue) { } } -function getCollectionExtents(collection: StacCollection) { - return collection.extent?.spatial?.bbox?.[0]; +function getCollectionExtents(collection: StacCollection): SpatialExtent { + const spatialExtent = collection.extent?.spatial; + // check if bbox is a list of lists, otherwise its a single list of nums + return Array.isArray(spatialExtent?.bbox?.[0]) ? spatialExtent?.bbox[0] : ((spatialExtent?.bbox as unknown) as SpatialExtent); } function getBbox( From 8fc0e6bdaa2f57d0d4564072d0546e84e2b27e14 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 18 Nov 2025 15:08:45 -0700 Subject: [PATCH 2/2] fix: formatting --- src/layers/map.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layers/map.tsx b/src/layers/map.tsx index 5c15898..e8f2c06 100644 --- a/src/layers/map.tsx +++ b/src/layers/map.tsx @@ -266,7 +266,9 @@ function valueToGeoJson(value: StacValue) { function getCollectionExtents(collection: StacCollection): SpatialExtent { const spatialExtent = collection.extent?.spatial; // check if bbox is a list of lists, otherwise its a single list of nums - return Array.isArray(spatialExtent?.bbox?.[0]) ? spatialExtent?.bbox[0] : ((spatialExtent?.bbox as unknown) as SpatialExtent); + return Array.isArray(spatialExtent?.bbox?.[0]) + ? spatialExtent?.bbox[0] + : (spatialExtent?.bbox as unknown as SpatialExtent); } function getBbox(