Skip to content

Commit 0e0e214

Browse files
committed
bugfix: road shields filter
sort POIs with symbol-sort-key
1 parent a963b32 commit 0e0e214

File tree

2 files changed

+40
-110
lines changed

2 files changed

+40
-110
lines changed

html/cyclemap-layers.json

+21-110
Original file line numberDiff line numberDiff line change
@@ -2174,8 +2174,16 @@
21742174
"minzoom": 10,
21752175
"maxzoom": 16,
21762176
"filter": ["all",
2177-
["match", ["get", "subclass"], ["motorway", "trunk", "primary", "secondary"], true, false],
2178-
["match", ["get", "ref_prefix"], ["A", "B"], true, false],
2177+
["any",
2178+
["all",
2179+
["==", ["get", "subclass"], "motorway"],
2180+
["==", ["get", "ref_prefix"], "A"]
2181+
],
2182+
["all",
2183+
["match", ["get", "subclass"], ["trunk", "primary", "secondary"], true, false],
2184+
["==", ["get", "ref_prefix"], "B"]
2185+
]
2186+
],
21792187
["!=", ["get", "ref_num"], ""],
21802188
["<=", ["length", ["get", "ref_num"]], 3]
21812189
],
@@ -2201,10 +2209,7 @@
22012209
"type": "symbol",
22022210
"source": "local",
22032211
"source-layer": "poi",
2204-
"filter": ["all",
2205-
["match", ["get", "subclass"], ["station", "halt", "bus_stop", "tram_stop", "restaurant", "biergarten", "hotel"], false, true],
2206-
["!=", ["get", "access"], 1]
2207-
],
2212+
"filter": ["!=", ["get", "access"], 1],
22082213
"minzoom": 11,
22092214
"maxzoom": 24,
22102215
"paint": {
@@ -2220,6 +2225,13 @@
22202225
"text-halo-blur": 1
22212226
},
22222227
"layout": {
2228+
"symbol-sort-key": ["match", ["get", "subclass"],
2229+
["station", "halt"], 10,
2230+
["bus_stop", "tram_stop"], 20,
2231+
["parking"], 30,
2232+
["restaurant", "fast_food", "alpine_hut", "pub", "biergarten"], 40,
2233+
255
2234+
],
22232235
"icon-padding": 10,
22242236
"icon-allow-overlap": false,
22252237
"icon-ignore-placement": false,
@@ -2304,110 +2316,6 @@
23042316
"text-max-width": 9
23052317
}
23062318
},
2307-
{
2308-
"id": "poi-prio",
2309-
"type": "symbol",
2310-
"source": "local",
2311-
"source-layer": "poi",
2312-
"filter": ["match", ["get", "subclass"], ["station", "halt", "bus_stop", "tram_stop", "restaurant", "biergarten", "hotel"], true, false],
2313-
"minzoom": 11,
2314-
"maxzoom": 24,
2315-
"paint": {
2316-
"text-color": ["match", ["get", "subclass"],
2317-
["station", "halt"], "#008",
2318-
["bus_stop", "tram_stop"], "#053",
2319-
["restaurant", "fast_food", "alpine_hut", "pub", "biergarten", "hotel", "bar", "information"], "#631",
2320-
["supermarket", "bicycle"], "#505",
2321-
["hospital"], "#a22",
2322-
"#222"],
2323-
"text-halo-color": "rgba(255, 255, 255, 0.8)",
2324-
"text-halo-width": 2.5,
2325-
"text-halo-blur": 1
2326-
},
2327-
"layout": {
2328-
"icon-padding": 10,
2329-
"icon-allow-overlap": false,
2330-
"icon-ignore-placement": false,
2331-
"icon-image": ["match", ["get", "subclass"],
2332-
["parking", "shelter", "supermarket", "bicycle", "hotel", "bar", "hospital", "caravan_site", "camp_site", "peak", "playground", "information", "viewpoint", "climbing"], ["get", "subclass"],
2333-
["pub", "biergarten"], "pub",
2334-
["bus_stop", "tram_stop"], "bus_stop",
2335-
["tower", "antenna", "mast", "communications_tower"], "tower",
2336-
["restaurant", "fast_food", "alpine_hut"], "restaurant",
2337-
["station", "halt"], ["match", ["get", "subway"], 1, "subway", "station.red"],
2338-
"place_of_worship", ["match", ["get", "religion"], 1, "church", ""],
2339-
"attraction", "ring-black",
2340-
"star.white"],
2341-
"icon-size": ["interpolate", ["exponential", 2], ["zoom"],
2342-
12, 0.5,
2343-
14, 1
2344-
],
2345-
"text-allow-overlap": false,
2346-
"text-ignore-placement": false,
2347-
"text-optional": true,
2348-
"text-anchor": "top",
2349-
"text-field": ["step", ["zoom"],
2350-
"",
2351-
12, ["match", ["get", "subclass"], ["station", "halt"], ["get", "name"], ""],
2352-
14, ["case",
2353-
["==", ["get", "count"], 1],
2354-
["match", ["get", "subclass"],
2355-
["station", "halt"], ["get", "name"],
2356-
["peak", "restaurant", "fast_food", "alpine_hut", "pub", "biergarten", "hotel", "bar"],
2357-
["case",
2358-
[">",["length", ["get", "name"]], 0], ["concat", ["get", "name"], "\n", ["get", "ele"]],
2359-
["concat", ["get", "ele"]]
2360-
],
2361-
""
2362-
],
2363-
""],
2364-
16, ["match",
2365-
["get", "count"],
2366-
1, ["match", ["get", "subclass"],
2367-
["bus_stop", "parking"], "",
2368-
["peak", "restaurant", "fast_food", "alpine_hut", "biergarten", "information"],
2369-
["case",
2370-
[">",["length", ["get", "name"]], 0], ["concat", ["get", "name"], "\n", ["get", "ele"]],
2371-
["concat", ["get", "ele"]]
2372-
],
2373-
["get", "name"]
2374-
],
2375-
2, ["match", ["get", "subclass"],
2376-
["station", "halt"], ["get", "name"],
2377-
""
2378-
],
2379-
""
2380-
],
2381-
17, ["match",
2382-
["get", "count"],
2383-
1, ["match", ["get", "subclass"],
2384-
["peak", "restaurant", "fast_food", "alpine_hut", "biergarten", "information", "climbing"],
2385-
["case",
2386-
[">",["length", ["get", "name"]], 0], ["concat", ["get", "name"], "\n", ["get", "ele"]],
2387-
["concat", ["get", "ele"]]
2388-
],
2389-
["get", "name"]
2390-
],
2391-
2, ["match", ["get", "subclass"],
2392-
["station", "halt", "bus_stop", "tram_stop"], ["get", "name"],
2393-
""
2394-
],
2395-
""
2396-
]
2397-
2398-
],
2399-
"text-font": ["match", ["get", "subclass"],
2400-
["peak", "restaurant", "fast_food", "alpine_hut", "pub", "biergarten", "hotel", "bar", "hospital", "information"], ["literal", ["Open Sans Bold Italic"]],
2401-
["literal",["Open Sans Italic"]]
2402-
],
2403-
"text-size": ["match",
2404-
["get", "subclass"],
2405-
["peak", "restaurant", "fast_food", "alpine_hut", "pub", "biergarten", "hotel", "bar", "hospital", "information"], 18,
2406-
16],
2407-
"text-offset": [0, 0.7],
2408-
"text-max-width": 9
2409-
}
2410-
},
24112319
{
24122320
"id": "global-places",
24132321
"type": "symbol",
@@ -2498,6 +2406,9 @@
24982406
"text-padding": 20,
24992407
"text-size": 24,
25002408
"text-max-width": 5,
2409+
"text-allow-overlap": false,
2410+
"text-ignore-placement": false,
2411+
25012412
"text-letter-spacing": 0
25022413
},
25032414
"paint": {

html/shadow-layers.json

+19
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"type": "fill",
2121
"source": "local",
2222
"source-layer": "landuse",
23+
"filter": ["match", ["get", "subclass"], ["residential", "commercial", "retail", "industrial", "aerodrome", "military"], true, false],
2324
"minzoom": 10,
2425
"maxzoom": 24,
2526
"paint": {
@@ -102,6 +103,24 @@
102103
"fill-color": "#aaa"
103104
}
104105
},
106+
{
107+
"id": "shiproute",
108+
"type": "line",
109+
"source": "local",
110+
"source-layer": "transportation",
111+
"minzoom": 10,
112+
"maxzoom": 24,
113+
"filter": ["==", ["get", "subclass"], "ferry"],
114+
"paint": {
115+
"line-dasharray": [4, 4],
116+
"line-color": "#ccc",
117+
"line-width": [
118+
"interpolate", ["exponential", 2], ["zoom"],
119+
10, 1,
120+
18, 16
121+
]
122+
}
123+
},
105124
{
106125
"id": "buildings",
107126
"type": "fill",

0 commit comments

Comments
 (0)