Skip to content

Commit

Permalink
Merge pull request #19
Browse files Browse the repository at this point in the history
Add additional basemap layers
  • Loading branch information
clementprdhomme authored Oct 31, 2024
2 parents 1c433db + 46d971c commit e6a6c12
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 10 additions & 0 deletions client/src/components/map/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ export const LABELS: Record<LabelsStyle, { name: string }> = {
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: {
Expand Down
2 changes: 0 additions & 2 deletions client/src/hooks/use-apply-map-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/use-map-basemap-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)[],
),
);
Expand Down

0 comments on commit e6a6c12

Please sign in to comment.