UX: change colours of footways, cycleways and paths; fix #2085

This commit is contained in:
Pieter Vander Vennet 2024-08-21 01:47:31 +02:00
parent 277d3d0754
commit 630372202f
3 changed files with 313 additions and 14 deletions

View file

@ -1731,6 +1731,98 @@
] ]
} }
}, },
{
"id": "roads_footway",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"filter": [
"all",
[
"==",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"footway"
]
],
"paint": {
"line-color": "#d46710",
"line-dasharray": [
3,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{
"id": "roads_cycleway",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"filter": [
"all",
[
"==",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"cycleway"
]
],
"paint": {
"line-color": "#6099c9",
"line-dasharray": [
3,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{ {
"id": "roads_other", "id": "roads_other",
"type": "line", "type": "line",
@ -1748,10 +1840,20 @@
"pmap:kind", "pmap:kind",
"other", "other",
"path" "path"
],
[
"!=",
"pmap:kind_detail",
"cycleway"
],
[
"!=",
"pmap:kind_detail",
"footway"
] ]
], ],
"paint": { "paint": {
"line-color": "#ebebeb", "line-color": "#cbbbab",
"line-dasharray": [ "line-dasharray": [
3, 3,
1 1
@ -2966,6 +3068,53 @@
] ]
} }
}, },
{
"id": "roads_bridges_cycleway_other",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"minzoom": 12,
"filter": [
"all",
[
">",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"cycleway"
]
],
"paint": {
"line-color": "#1069c9",
"line-dasharray": [
2,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{ {
"id": "roads_bridges_other", "id": "roads_bridges_other",
"type": "line", "type": "line",

View file

@ -585,7 +585,8 @@
"paint": { "paint": {
"line-color": "#85c2e9", "line-color": "#85c2e9",
"line-dasharray": [ "line-dasharray": [
0.75,1.75 0.75,
1.75
], ],
"line-width": [ "line-width": [
"interpolate", "interpolate",
@ -1729,6 +1730,98 @@
] ]
} }
}, },
{
"id": "roads_footway",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"filter": [
"all",
[
"==",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"footway"
]
],
"paint": {
"line-color": "#d46710",
"line-dasharray": [
3,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{
"id": "roads_cycleway",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"filter": [
"all",
[
"==",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"cycleway"
]
],
"paint": {
"line-color": "#6099c9",
"line-dasharray": [
3,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{ {
"id": "roads_other", "id": "roads_other",
"type": "line", "type": "line",
@ -1746,10 +1839,20 @@
"pmap:kind", "pmap:kind",
"other", "other",
"path" "path"
],
[
"!=",
"pmap:kind_detail",
"cycleway"
],
[
"!=",
"pmap:kind_detail",
"footway"
] ]
], ],
"paint": { "paint": {
"line-color": "#ebebeb", "line-color": "#cbbbab",
"line-dasharray": [ "line-dasharray": [
3, 3,
1 1
@ -2719,7 +2822,6 @@
] ]
} }
}, },
{ {
"id": "roads_bridges_highway", "id": "roads_bridges_highway",
"type": "line", "type": "line",
@ -2776,9 +2878,7 @@
13 13
] ]
} }
}, },
{ {
"id": "roads_bridges_minor", "id": "roads_bridges_minor",
"type": "line", "type": "line",
@ -2873,7 +2973,6 @@
] ]
} }
}, },
{ {
"id": "roads_bridges_medium", "id": "roads_bridges_medium",
"type": "line", "type": "line",
@ -2968,7 +3067,53 @@
] ]
} }
}, },
{
"id": "roads_bridges_cycleway_other",
"type": "line",
"source": "protomaps",
"source-layer": "roads",
"minzoom": 12,
"filter": [
"all",
[
">",
"pmap:level",
0
],
[
"in",
"pmap:kind",
"other",
"path"
],
[
"==",
"pmap:kind_detail",
"cycleway"
]
],
"paint": {
"line-color": "#1069c9",
"line-dasharray": [
2,
1
],
"line-width": [
"interpolate",
[
"exponential",
1.6
],
[
"zoom"
],
14,
0,
20,
7
]
}
},
{ {
"id": "roads_bridges_other", "id": "roads_bridges_other",
"type": "line", "type": "line",
@ -3011,7 +3156,6 @@
] ]
} }
}, },
{ {
"id": "physical_line_waterway_label", "id": "physical_line_waterway_label",
"type": "symbol", "type": "symbol",

View file

@ -7,14 +7,20 @@ export class GenerateSunnyUnlabeled extends Script {
super("Generates 'sunny-unlabeled.json' based on sunny.json") super("Generates 'sunny-unlabeled.json' based on sunny.json")
} }
async main(args: string[]): Promise<void> {
generateUnlabeled() {
const unlabeled = { "#": "AUTOMATICALLY GENERATED! Do not edit.", ...sunny } const unlabeled = { "#": "AUTOMATICALLY GENERATED! Do not edit.", ...sunny }
unlabeled.name = unlabeled.name + "-unlabeled" unlabeled.name = unlabeled.name + "-unlabeled"
unlabeled.layers = sunny.layers.filter( unlabeled.layers = sunny.layers.filter(
(l) => l.type !== "symbol" || !l.layout["text-field"] (l) => l.type !== "symbol" || !l.layout["text-field"],
) )
writeFileSync("public/assets/sunny-unlabeled.json", JSON.stringify(unlabeled, null, " ")) writeFileSync("public/assets/sunny-unlabeled.json", JSON.stringify(unlabeled, null, " "))
} }
async main(args: string[]): Promise<void> {
this.generateUnlabeled()
}
} }
new GenerateSunnyUnlabeled().run() new GenerateSunnyUnlabeled().run()