From 6a6fe9346519f337b71f8a0b353f27e261788b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Thu, 31 Oct 2024 09:40:26 +0100 Subject: [PATCH 1/3] style(client): Remove `console.log` --- client/src/hooks/use-apply-map-settings.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/hooks/use-apply-map-settings.ts b/client/src/hooks/use-apply-map-settings.ts index e520011..9aadfea 100644 --- a/client/src/hooks/use-apply-map-settings.ts +++ b/client/src/hooks/use-apply-map-settings.ts @@ -12,8 +12,6 @@ export default function useApplyMapSettings(map: MapRef | null) { const [labels] = useMapLabels(); const [basemapLayers] = useMapBasemapLayers(); - console.log(basemapLayers); - useEffect(() => { if (map) { toggleGroupLayers(map, "basemap-", (group) => group === `basemap-${basemap}`); From 6207c99322382921f4d6e5c3b44110a979dfe89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Thu, 31 Oct 2024 10:00:51 +0100 Subject: [PATCH 2/3] feat(client): Add new basemap layers --- client/src/components/map/constants.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/components/map/constants.ts b/client/src/components/map/constants.ts index 494f331..0bd56b3 100644 --- a/client/src/components/map/constants.ts +++ b/client/src/components/map/constants.ts @@ -47,6 +47,16 @@ export const LABELS: Record = { export const BASEMAP_LAYERS = { "admin-boundaries": { group: "Boundaries", name: "Administrative boundaries" }, "hydro-boundaries": { group: "Boundaries", name: "Hydrological basins" }, + "populated-infrastructures": { group: "Infrastructures", name: "Populated infrastructures" }, + "transportation-network-infrastructures": { + group: "Infrastructures", + name: "Transportation network", + }, + "water-related-infrastructures": { + group: "Infrastructures", + name: "Water-related infrastructures", + }, + "hydrographic-data": { group: "Water bodies", name: "Hydrographic data" }, } as const; export const DEFAULT_MAP_SETTINGS: { From 46d971c99252ee7551eaf9d4677fc7e6d363911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Thu, 31 Oct 2024 10:10:28 +0100 Subject: [PATCH 3/3] fix(client): Incorrect `useMapBasemapLayers` hook --- client/src/hooks/use-map-basemap-layers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/hooks/use-map-basemap-layers.ts b/client/src/hooks/use-map-basemap-layers.ts index 12da575..b4ef8bf 100644 --- a/client/src/hooks/use-map-basemap-layers.ts +++ b/client/src/hooks/use-map-basemap-layers.ts @@ -5,7 +5,7 @@ import { BASEMAP_LAYERS, DEFAULT_MAP_SETTINGS } from "@/components/map/constants export default function useMapBasemapLayers() { return useQueryState( "basemap-layers", - parseAsArrayOf(parseAsStringLiteral(DEFAULT_MAP_SETTINGS.basemapLayers)).withDefault( + parseAsArrayOf(parseAsStringLiteral(Object.keys(BASEMAP_LAYERS))).withDefault( DEFAULT_MAP_SETTINGS.basemapLayers as (keyof typeof BASEMAP_LAYERS)[], ), );