diff --git a/components/src/maplibre/MapStyle/SWRDataLabDark.ts b/components/src/maplibre/MapStyle/SWRDataLabDark.ts index 2427a45f..8f0e209c 100644 --- a/components/src/maplibre/MapStyle/SWRDataLabDark.ts +++ b/components/src/maplibre/MapStyle/SWRDataLabDark.ts @@ -165,7 +165,7 @@ const style: styleFunction = (opts) => { ...(options.places?.showLabels ? placeLabels : []), // 11. Admin boundary labels - ...boundaryLabels + ...(options.admin?.showLabels ? boundaryLabels : []) ] }; }; diff --git a/components/src/maplibre/MapStyle/SWRDataLabLight.mdx b/components/src/maplibre/MapStyle/SWRDataLabLight.mdx index 8282f853..a245def4 100644 --- a/components/src/maplibre/MapStyle/SWRDataLabLight.mdx +++ b/components/src/maplibre/MapStyle/SWRDataLabLight.mdx @@ -89,13 +89,14 @@ interface StyleOptions { enableBuildingExtrusions?: boolean; enableHillshade?: boolean; roads?: { - showLabels?: boolean + showLabels?: boolean; } places?: { - showLabels?: boolean + showLabels?: boolean; } admin?: { - show?: boolean | []AdminLevel + show?: boolean | []AdminLevel; + showLabels: boolean; } } ``` diff --git a/components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte b/components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte index 90686e67..3c7bfa00 100644 --- a/components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte +++ b/components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte @@ -64,6 +64,28 @@ + + +
+
+ + + +
+
+
+
diff --git a/components/src/maplibre/MapStyle/SWRDataLabLight.ts b/components/src/maplibre/MapStyle/SWRDataLabLight.ts index 91541c9e..4e4a18f8 100644 --- a/components/src/maplibre/MapStyle/SWRDataLabLight.ts +++ b/components/src/maplibre/MapStyle/SWRDataLabLight.ts @@ -164,7 +164,7 @@ const style: styleFunction = (opts) => { ...(options.places?.showLabels ? placeLabels : []), // 11. Admin boundary labels - ...boundaryLabels + ...(options.admin?.showLabels ? boundaryLabels : []) ] }; }; diff --git a/components/src/maplibre/MapStyle/defaultOptions.ts b/components/src/maplibre/MapStyle/defaultOptions.ts index 77800ca5..fc0d4e74 100644 --- a/components/src/maplibre/MapStyle/defaultOptions.ts +++ b/components/src/maplibre/MapStyle/defaultOptions.ts @@ -9,7 +9,8 @@ const opts: StyleOptions = { showLabels: true }, admin: { - show: true + show: true, + showLabels: true } }; diff --git a/components/src/maplibre/MapStyle/types.ts b/components/src/maplibre/MapStyle/types.ts index c8251dab..d392934c 100644 --- a/components/src/maplibre/MapStyle/types.ts +++ b/components/src/maplibre/MapStyle/types.ts @@ -10,6 +10,7 @@ interface StyleOptions { }; admin?: { show?: boolean | AdminLevel[]; + showLabels?: boolean; }; roads?: { showLabels?: boolean;