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
20 changes: 20 additions & 0 deletions components/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@
</DesignTokens>
</Story>

<Story asChild name="fix/115">
<DesignTokens>
<div class="grid">
<div class="container">
<Map
showDebug
style={SWRDataLabLight()}
initialLocation={{
lng: 10.923994803290498,
lat: 52.28235776595122,
zoom: 14.99,
pitch: 0
}}
>
<AttributionControl position="bottom-left" />
</Map>
</div>
</div>
</DesignTokens>
</Story>
<Story asChild name="Bodensee z9">
<DesignTokens>
<div class="grid">
Expand Down
235 changes: 56 additions & 179 deletions components/src/maplibre/MapStyle/components/Roads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,48 @@ const street_secondary = {
}
};
const street_secondary_case = {
line_width: {
stops: [
[12, 0],
[14, 3],
[16, 10],
[18, 30],
[19, 66],
[20, 40]
]
}
paint: {
'line-color': tokens.street_secondary_case,
'line-width': {
stops: [
[12, 0],
[14, 3],
[16, 11],
[18, 30],
[19, 66],
[20, 40]
]
},
'line-opacity': {
stops: [
[11, 0],
[12, 1]
]
}
},
layout: case_layout
};
const street_tertiary_case = {
paint: {
'line-color': tokens.street_tertiary_case,
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
};

const street_residential = {
Expand Down Expand Up @@ -353,36 +385,13 @@ export default function makeRoads() {
{
id: 'bridge-street-tertiary-link:case',
filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
paint: {
'line-color': 'rgb(217,217,217)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'bridge-street-secondary-link:case',
filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'secondary'], ['==', 'link', true]],
paint: {
'line-color': tokens.street_secondary_case,
'line-width': street_secondary_case.line_width
},
layout: case_layout,
minzoom: 13
minzoom: 13,
...street_secondary_case
},
{
id: 'bridge-street-primary-link:case',
Expand Down Expand Up @@ -418,41 +427,12 @@ export default function makeRoads() {
{
id: 'bridge-street-tertiary:case',
filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
paint: {
'line-color': 'rgb(217,217,217)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'bridge-street-secondary:case',
filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'secondary'], ['!=', 'link', true]],
paint: {
'line-color': tokens.street_secondary_case,
'line-width': street_secondary_case.line_width,
'line-opacity': {
stops: [
[11, 0],
[12, 1]
]
}
},
layout: case_layout
...street_secondary_case
},
{
id: 'bridge-street-primary:case',
Expand Down Expand Up @@ -802,37 +782,17 @@ export default function makeRoads() {
{
id: 'tunnel-street-tertiary-link:case',
filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['==', 'link', true]],
paint: {
'line-color': 'rgb(222,222,222)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'tunnel-street-secondary-link:case',
type: 'line',
filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'secondary'], ['==', 'link', true]],
paint: {
'line-color': tokens.street_secondary_case,
...street_secondary_case.paint,
'line-dasharray': [1, 0.3],
'line-width': street_secondary.line_width
},
layout: case_layout,
layout: street_secondary_case.layout,
minzoom: 13
},
{
Expand Down Expand Up @@ -870,42 +830,12 @@ export default function makeRoads() {
{
id: 'tunnel-street-tertiary:case',
filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'tertiary'], ['!=', 'link', true]],
paint: {
'line-color': 'rgb(222,222,222)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'tunnel-street-secondary:case',
filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'secondary'], ['!=', 'link', true]],
paint: {
'line-color': tokens.street_secondary_case,
'line-dasharray': [1, 0.3],
'line-width': street_secondary_case.line_width,
'line-opacity': {
stops: [
[11, 0],
[12, 1]
]
}
},
layout: case_layout
...street_secondary_case
},
{
id: 'tunnel-street-primary:case',
Expand Down Expand Up @@ -1288,26 +1218,7 @@ export default function makeRoads() {
['in', 'kind', 'tertiary'],
['==', 'link', true]
],
paint: {
'line-color': 'hsl(36,0%,80%)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'street-secondary-link:case',
Expand All @@ -1318,12 +1229,7 @@ export default function makeRoads() {
['in', 'kind', 'secondary'],
['==', 'link', true]
],
paint: {
'line-color': tokens.street_secondary_case,
'line-width': street_secondary_case.line_width
},
layout: case_layout,
minzoom: 13
...street_secondary_case
},
{
id: 'street-primary-link:case',
Expand Down Expand Up @@ -1382,26 +1288,7 @@ export default function makeRoads() {
['in', 'kind', 'tertiary'],
['!=', 'link', true]
],
paint: {
'line-color': 'hsl(36,0%,80%)',
'line-width': {
stops: [
[12, 2],
[14, 3],
[16, 6],
[18, 26],
[19, 64],
[20, 128]
]
},
'line-opacity': {
stops: [
[12, 0],
[13, 1]
]
}
},
layout: case_layout
...street_tertiary_case
},
{
id: 'street-secondary:case',
Expand All @@ -1412,17 +1299,7 @@ export default function makeRoads() {
['in', 'kind', 'secondary'],
['!=', 'link', true]
],
paint: {
'line-color': tokens.street_secondary_case,
'line-width': street_secondary_case.line_width,
'line-opacity': {
stops: [
[11, 0],
[12, 1]
]
}
},
layout: case_layout
...street_secondary_case
},
{
id: 'street-primary:case',
Expand Down
2 changes: 1 addition & 1 deletion components/src/maplibre/MapStyle/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const tokens = {
street_primary: 'hsl(0, 0%, 96%)',
street_primary_case: 'hsl(0, 0%, 75%)',
street_secondary: 'hsl(0, 0%, 95%)',
street_secondary_case: 'hsl(0, 0%, 50%)',
street_secondary_case: 'hsl(0, 0%, 75%)',
street_tertiary: 'hsl(0, 0%, 95%)',
street_tertiary_case: 'hsl(0, 0%, 70%)',
label_primary: 'hsl(240, 5%, 10%)',
Expand Down
Loading