Skip to content

Commit 4f6851a

Browse files
committed
fix: show static catalogs on map
1 parent 3f89d04 commit 4f6851a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/map.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type { StacCollection } from "stac-ts";
1818
import useStacMap from "../hooks/stac-map";
1919
import type { StacValue } from "../types/stac";
2020
import { useColorModeValue } from "./ui/color-mode";
21+
import { useChildren } from "../hooks/stac-value";
2122

2223
const fillColor: [number, number, number, number] = [207, 63, 2, 50];
2324
const lineColor: [number, number, number, number] = [207, 63, 2, 100];
@@ -51,11 +52,15 @@ export default function Map() {
5152
stacGeoparquetMetadata,
5253
setStacGeoparquetItemId,
5354
} = useStacMap();
55+
const children = useChildren(value, !collections);
5456
const {
5557
geojson,
5658
bbox: valueBbox,
5759
filled,
58-
} = useStacValueLayerProperties(value, collections);
60+
} = useStacValueLayerProperties(
61+
value,
62+
collections || children.filter((child) => child.type === "Collection"),
63+
);
5964
const small = useBreakpointValue({ base: true, md: false });
6065
const bbox = valueBbox || stacGeoparquetMetadata?.bbox;
6166

0 commit comments

Comments
 (0)