Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/src/maplibre/MapStyle/SWRDataLabDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const style: styleFunction = (opts) => {
...(options.places?.showLabels ? placeLabels : []),

// 11. Admin boundary labels
...boundaryLabels
...(options.admin?.showLabels ? boundaryLabels : [])
]
};
};
Expand Down
7 changes: 4 additions & 3 deletions components/src/maplibre/MapStyle/SWRDataLabLight.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
```
Expand Down
22 changes: 22 additions & 0 deletions components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@
</div>
</DesignTokens>
</Story>
<Story asChild name="Hide admin labels">
<DesignTokens theme="light">
<div class="grid">
<div class="container">
<Map
showDebug
style={SWRDataLabLight({
admin: { show: true, showLabels: false }
})}
initialLocation={{
lng: 7.57,
lat: 49.3,
zoom: 7.66,
pitch: 0
}}
>
<AttributionControl position="bottom-left" />
</Map>
</div>
</div>
</DesignTokens>
</Story>
<Story asChild name="fix/122">
<DesignTokens theme="light">
<div class="grid">
Expand Down
2 changes: 1 addition & 1 deletion components/src/maplibre/MapStyle/SWRDataLabLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const style: styleFunction = (opts) => {
...(options.places?.showLabels ? placeLabels : []),

// 11. Admin boundary labels
...boundaryLabels
...(options.admin?.showLabels ? boundaryLabels : [])
]
};
};
Expand Down
3 changes: 2 additions & 1 deletion components/src/maplibre/MapStyle/defaultOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const opts: StyleOptions = {
showLabels: true
},
admin: {
show: true
show: true,
showLabels: true
}
};

Expand Down
1 change: 1 addition & 0 deletions components/src/maplibre/MapStyle/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface StyleOptions {
};
admin?: {
show?: boolean | AdminLevel[];
showLabels?: boolean;
};
roads?: {
showLabels?: boolean;
Expand Down