@swr-data-lab/components 1.11.2 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.storybook/blocks/Mermaid.jsx +9 -0
  2. package/.storybook/main.ts +23 -17
  3. package/.storybook/preview.ts +42 -13
  4. package/package.json +72 -68
  5. package/src/DesignTokens/Tokens.ts +15 -12
  6. package/src/Select/Select.stories.svelte +3 -3
  7. package/src/Switcher/Switcher.svelte +1 -0
  8. package/src/index.js +12 -0
  9. package/src/maplibre/AttributionControl/AttributionControl.stories.svelte +29 -0
  10. package/src/maplibre/AttributionControl/AttributionControl.svelte +45 -0
  11. package/src/maplibre/AttributionControl/index.js +2 -0
  12. package/src/maplibre/GeocoderControl/GeocoderAPIs.ts +49 -0
  13. package/src/maplibre/GeocoderControl/GeocoderControl.stories.svelte +78 -0
  14. package/src/maplibre/GeocoderControl/GeocoderControl.svelte +207 -0
  15. package/src/maplibre/GeocoderControl/index.js +2 -0
  16. package/src/maplibre/Map/FallbackStyle.ts +18 -0
  17. package/src/maplibre/Map/Map.stories.svelte +118 -0
  18. package/src/maplibre/Map/Map.svelte +283 -0
  19. package/src/maplibre/Map/index.js +2 -0
  20. package/src/maplibre/MapControl/MapControl.mdx +12 -0
  21. package/src/maplibre/MapControl/MapControl.stories.svelte +56 -0
  22. package/src/maplibre/MapControl/MapControl.svelte +41 -0
  23. package/src/maplibre/MapControl/index.js +2 -0
  24. package/src/maplibre/MapStyle/SWRDataLabLight.mdx +86 -0
  25. package/src/maplibre/MapStyle/SWRDataLabLight.stories.svelte +41 -0
  26. package/src/maplibre/MapStyle/SWRDataLabLight.ts +72 -0
  27. package/src/maplibre/MapStyle/components/Admin.ts +173 -0
  28. package/src/maplibre/MapStyle/components/Buildings.ts +23 -0
  29. package/src/maplibre/MapStyle/components/Landuse.ts +499 -0
  30. package/src/maplibre/MapStyle/components/Natural.ts +1 -0
  31. package/src/maplibre/MapStyle/components/PlaceLabels.ts +199 -0
  32. package/src/maplibre/MapStyle/components/Roads.ts +2345 -0
  33. package/src/maplibre/MapStyle/components/Transit.ts +507 -0
  34. package/src/maplibre/MapStyle/components/Walking.ts +1538 -0
  35. package/src/maplibre/MapStyle/index.js +2 -0
  36. package/src/maplibre/MapStyle/tokens.ts +21 -0
  37. package/src/maplibre/Maplibre.mdx +91 -0
  38. package/src/maplibre/NavigationControl/NavigationControl.stories.svelte +39 -0
  39. package/src/maplibre/NavigationControl/NavigationControl.svelte +36 -0
  40. package/src/maplibre/NavigationControl/index.js +2 -0
  41. package/src/maplibre/ScaleControl/ScaleControl.stories.svelte +71 -0
  42. package/src/maplibre/ScaleControl/ScaleControl.svelte +25 -0
  43. package/src/maplibre/ScaleControl/index.js +2 -0
  44. package/src/maplibre/Source/MapSource.stories.svelte +9 -0
  45. package/src/maplibre/Source/MapSource.svelte +61 -0
  46. package/src/maplibre/Source/index.js +2 -0
  47. package/src/maplibre/Source/source.ts +89 -0
  48. package/src/maplibre/Tooltip/Tooltip.stories.svelte +192 -0
  49. package/src/maplibre/Tooltip/Tooltip.svelte +175 -0
  50. package/src/maplibre/Tooltip/index.js +2 -0
  51. package/src/maplibre/VectorLayer/VectorLayer.stories.svelte +65 -0
  52. package/src/maplibre/VectorLayer/VectorLayer.svelte +142 -0
  53. package/src/maplibre/VectorLayer/index.js +2 -0
  54. package/src/maplibre/VectorTileSource/VectorTileSource.mdx +19 -0
  55. package/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte +46 -0
  56. package/src/maplibre/VectorTileSource/VectorTileSource.svelte +24 -0
  57. package/src/maplibre/VectorTileSource/index.js +2 -0
  58. package/src/maplibre/WithLinkLocation/WithLinkLocation.mdx +11 -0
  59. package/src/maplibre/WithLinkLocation/WithLinkLocation.stories.svelte +29 -0
  60. package/src/maplibre/WithLinkLocation/WithLinkLocation.svelte +83 -0
  61. package/src/maplibre/WithLinkLocation/index.js +2 -0
  62. package/src/maplibre/context.svelte.ts +89 -0
  63. package/src/maplibre/types.ts +12 -0
  64. package/src/maplibre/utils.ts +52 -0
  65. package/tsconfig.json +1 -0
  66. package/src/events/clickOutside.js +0 -23
@@ -0,0 +1,1538 @@
1
+ import { type Layer } from '../../types';
2
+ import tokens from '../tokens';
3
+ import type { SymbolLayerSpecification } from 'maplibre-gl';
4
+
5
+ const street_layout = {
6
+ 'line-join': 'round',
7
+ 'line-cap': 'butt'
8
+ };
9
+
10
+ const street_residential = {
11
+ line_color: tokens.street_tertiary,
12
+ line_width: {
13
+ stops: [
14
+ [13, 1],
15
+ [14, 2],
16
+ [16, 5],
17
+ [18, 24],
18
+ [19, 60],
19
+ [20, 120]
20
+ ]
21
+ },
22
+ line_opacity: {
23
+ stops: [
24
+ [12, 0],
25
+ [13, 1]
26
+ ]
27
+ }
28
+ };
29
+
30
+ export default function makeWalking(): any {
31
+ const walkingTunnels: Layer[] = [
32
+ {
33
+ id: 'tunnel-street-pedestrian-zone',
34
+ type: 'fill',
35
+ 'source-layer': 'street_polygons',
36
+ filter: ['all', ['==', 'tunnel', true], ['==', 'kind', 'pedestrian']],
37
+ paint: {
38
+ 'fill-color': 'rgb(247,247,247)',
39
+ 'fill-opacity': {
40
+ stops: [
41
+ [12, 0],
42
+ [13, 1]
43
+ ]
44
+ }
45
+ }
46
+ },
47
+ {
48
+ id: 'tunnel-way-footway:outline',
49
+ type: 'line',
50
+ 'source-layer': 'streets',
51
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'footway']],
52
+ layout: {
53
+ 'line-cap': 'round'
54
+ },
55
+ paint: {
56
+ 'line-width': {
57
+ stops: [
58
+ [15, 0],
59
+ [16, 5],
60
+ [18, 7],
61
+ [19, 12],
62
+ [20, 22]
63
+ ]
64
+ },
65
+ 'line-color': 'hsl(0,0%,86%)'
66
+ },
67
+ minzoom: 15
68
+ },
69
+ {
70
+ id: 'tunnel-way-steps:outline',
71
+ type: 'line',
72
+ 'source-layer': 'streets',
73
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'steps']],
74
+ layout: {
75
+ 'line-cap': 'round'
76
+ },
77
+ paint: {
78
+ 'line-width': {
79
+ stops: [
80
+ [15, 0],
81
+ [16, 5],
82
+ [18, 7],
83
+ [19, 12],
84
+ [20, 22]
85
+ ]
86
+ },
87
+ 'line-color': 'hsl(0,0%,86%)'
88
+ },
89
+ minzoom: 15
90
+ },
91
+ {
92
+ id: 'tunnel-way-path:outline',
93
+ type: 'line',
94
+ 'source-layer': 'streets',
95
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'path']],
96
+ layout: {
97
+ 'line-cap': 'round'
98
+ },
99
+ paint: {
100
+ 'line-width': {
101
+ stops: [
102
+ [15, 0],
103
+ [16, 5],
104
+ [18, 7],
105
+ [19, 12],
106
+ [20, 22]
107
+ ]
108
+ },
109
+ 'line-color': 'hsl(0,0%,86%)'
110
+ },
111
+ minzoom: 15
112
+ },
113
+ {
114
+ id: 'tunnel-way-cycleway:outline',
115
+ type: 'line',
116
+ 'source-layer': 'streets',
117
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'cycleway']],
118
+ layout: {
119
+ 'line-cap': 'round'
120
+ },
121
+ paint: {
122
+ 'line-width': {
123
+ stops: [
124
+ [15, 0],
125
+ [16, 5],
126
+ [18, 7],
127
+ [19, 12],
128
+ [20, 22]
129
+ ]
130
+ },
131
+ 'line-color': 'hsl(0,0%,87%)'
132
+ },
133
+ minzoom: 15
134
+ },
135
+ {
136
+ // See: https://wiki.openstreetmap.org/wiki/Tag:highway%3Dtrack
137
+ id: 'tunnel-street-track:outline',
138
+ type: 'line',
139
+ 'source-layer': 'streets',
140
+ filter: ['all', ['==', 'kind', 'track'], ['==', 'tunnel', true]],
141
+ paint: {
142
+ 'line-color': 'rgb(222,222,222)',
143
+ 'line-width': {
144
+ stops: [
145
+ [14, 2],
146
+ [16, 4],
147
+ [18, 18],
148
+ [19, 48],
149
+ [20, 96]
150
+ ]
151
+ },
152
+ 'line-opacity': {
153
+ stops: [
154
+ [14, 0],
155
+ [15, 1]
156
+ ]
157
+ }
158
+ },
159
+ layout: {
160
+ 'line-join': 'round',
161
+ 'line-cap': 'round'
162
+ }
163
+ },
164
+ {
165
+ id: 'tunnel-street-pedestrian:outline',
166
+ type: 'line',
167
+ 'source-layer': 'streets',
168
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['==', 'tunnel', true]],
169
+ paint: {
170
+ 'line-color': 'rgb(222,222,222)',
171
+ 'line-width': {
172
+ stops: [
173
+ [12, 2],
174
+ [14, 3],
175
+ [16, 6],
176
+ [18, 26],
177
+ [19, 64],
178
+ [20, 128]
179
+ ]
180
+ },
181
+ 'line-opacity': {
182
+ stops: [
183
+ [12, 0],
184
+ [13, 1]
185
+ ]
186
+ }
187
+ },
188
+ layout: {
189
+ 'line-join': 'round',
190
+ 'line-cap': 'round'
191
+ }
192
+ },
193
+ {
194
+ id: 'tunnel-way-footway', // See: https://wiki.openstreetmap.org/wiki/Tag:highway%3Dfootway
195
+ type: 'line',
196
+ 'source-layer': 'streets',
197
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'footway']],
198
+ layout: {
199
+ 'line-cap': 'round'
200
+ },
201
+ paint: {
202
+ 'line-width': {
203
+ stops: [
204
+ [15, 0],
205
+ [16, 4],
206
+ [18, 6],
207
+ [19, 10],
208
+ [20, 20]
209
+ ]
210
+ },
211
+ 'line-color': 'hsl(0,0%,94%)',
212
+ 'line-dasharray': [1, 0.2]
213
+ },
214
+ minzoom: 15
215
+ },
216
+ {
217
+ id: 'tunnel-way-steps',
218
+ type: 'line',
219
+ 'source-layer': 'streets',
220
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'steps']],
221
+ layout: {
222
+ 'line-cap': 'round'
223
+ },
224
+ paint: {
225
+ 'line-width': {
226
+ stops: [
227
+ [15, 0],
228
+ [16, 4],
229
+ [18, 6],
230
+ [19, 10],
231
+ [20, 20]
232
+ ]
233
+ },
234
+ 'line-color': 'hsl(0,0%,94%)',
235
+ 'line-dasharray': [1, 0.2]
236
+ },
237
+ minzoom: 15
238
+ },
239
+ {
240
+ id: 'tunnel-way-path',
241
+ type: 'line',
242
+ 'source-layer': 'streets',
243
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'path']],
244
+ layout: {
245
+ 'line-cap': 'round'
246
+ },
247
+ paint: {
248
+ 'line-width': {
249
+ stops: [
250
+ [15, 0],
251
+ [16, 4],
252
+ [18, 6],
253
+ [19, 10],
254
+ [20, 20]
255
+ ]
256
+ },
257
+ 'line-color': 'hsl(0,0%,94%)',
258
+ 'line-dasharray': [1, 0.2]
259
+ },
260
+ minzoom: 15
261
+ },
262
+ {
263
+ id: 'tunnel-way-cycleway',
264
+ type: 'line',
265
+ 'source-layer': 'streets',
266
+ filter: ['all', ['==', 'tunnel', true], ['in', 'kind', 'cycleway']],
267
+ layout: {
268
+ 'line-cap': 'round'
269
+ },
270
+ paint: {
271
+ 'line-width': {
272
+ stops: [
273
+ [15, 0],
274
+ [16, 4],
275
+ [18, 6],
276
+ [19, 10],
277
+ [20, 20]
278
+ ]
279
+ },
280
+ 'line-color': 'hsl(0,0%,95%)',
281
+ 'line-dasharray': [1, 0.2]
282
+ },
283
+ minzoom: 15
284
+ },
285
+ {
286
+ id: 'tunnel-street-track',
287
+ type: 'line',
288
+ 'source-layer': 'streets',
289
+ filter: ['all', ['==', 'kind', 'track'], ['==', 'tunnel', true]],
290
+ paint: {
291
+ 'line-color': 'rgb(247,247,247)',
292
+ 'line-width': {
293
+ stops: [
294
+ [14, 1],
295
+ [16, 3],
296
+ [18, 16],
297
+ [19, 44],
298
+ [20, 88]
299
+ ]
300
+ },
301
+ 'line-opacity': {
302
+ stops: [
303
+ [14, 0],
304
+ [15, 1]
305
+ ]
306
+ }
307
+ },
308
+ layout: {
309
+ 'line-join': 'round',
310
+ 'line-cap': 'round'
311
+ }
312
+ },
313
+ {
314
+ id: 'tunnel-street-pedestrian',
315
+ type: 'line',
316
+ 'source-layer': 'streets',
317
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['==', 'tunnel', true]],
318
+ paint: {
319
+ 'line-color': 'rgb(247,247,247)',
320
+ 'line-width': {
321
+ stops: [
322
+ [12, 1],
323
+ [14, 2],
324
+ [16, 5],
325
+ [18, 24],
326
+ [19, 60],
327
+ [20, 120]
328
+ ]
329
+ },
330
+ 'line-opacity': {
331
+ stops: [
332
+ [12, 0],
333
+ [13, 1]
334
+ ]
335
+ }
336
+ },
337
+ layout: {
338
+ 'line-join': 'round',
339
+ 'line-cap': 'round'
340
+ }
341
+ },
342
+ {
343
+ id: 'tunnel-street-livingstreet-bicycle',
344
+ type: 'line',
345
+ 'source-layer': 'streets',
346
+ filter: [
347
+ 'all',
348
+ ['==', 'kind', 'living_street'],
349
+ ['==', 'bicycle', 'designated'],
350
+ ['==', 'tunnel', true]
351
+ ],
352
+ paint: {
353
+ 'line-color': 'hsl(203,0%,97%)',
354
+ 'line-width': {
355
+ stops: [
356
+ [12, 1],
357
+ [14, 2],
358
+ [16, 5],
359
+ [18, 24],
360
+ [19, 60],
361
+ [20, 120]
362
+ ]
363
+ },
364
+ 'line-opacity': {
365
+ stops: [
366
+ [12, 0],
367
+ [13, 1]
368
+ ]
369
+ }
370
+ },
371
+ layout: street_layout
372
+ },
373
+ {
374
+ id: 'tunnel-street-residential-bicycle',
375
+ type: 'line',
376
+ 'source-layer': 'streets',
377
+ filter: [
378
+ 'all',
379
+ ['==', 'kind', 'residential'],
380
+ ['==', 'bicycle', 'designated'],
381
+ ['==', 'tunnel', true]
382
+ ],
383
+ paint: {
384
+ 'line-color': street_residential.line_color,
385
+ 'line-width': street_residential.line_width,
386
+ 'line-opacity': street_residential.line_opacity
387
+ },
388
+ layout: street_layout
389
+ },
390
+ {
391
+ id: 'tunnel-street-unclassified-bicycle',
392
+ type: 'line',
393
+ 'source-layer': 'streets',
394
+ filter: [
395
+ 'all',
396
+ ['==', 'kind', 'unclassified'],
397
+ ['==', 'bicycle', 'designated'],
398
+ ['==', 'tunnel', true]
399
+ ],
400
+ paint: {
401
+ 'line-color': 'hsl(203,0%,97%)',
402
+ 'line-width': {
403
+ stops: [
404
+ [12, 1],
405
+ [14, 2],
406
+ [16, 5],
407
+ [18, 24],
408
+ [19, 60],
409
+ [20, 120]
410
+ ]
411
+ },
412
+ 'line-opacity': {
413
+ stops: [
414
+ [12, 0],
415
+ [13, 1]
416
+ ]
417
+ }
418
+ },
419
+ layout: street_layout
420
+ },
421
+ {
422
+ id: 'tunnel-street-track-bicycle',
423
+ type: 'line',
424
+ 'source-layer': 'streets',
425
+ filter: [
426
+ 'all',
427
+ ['==', 'kind', 'track'],
428
+ ['==', 'bicycle', 'designated'],
429
+ ['==', 'tunnel', true]
430
+ ],
431
+ paint: {
432
+ 'line-color': 'rgb(247,247,247)'
433
+ },
434
+ layout: {
435
+ 'line-join': 'round',
436
+ 'line-cap': 'round'
437
+ }
438
+ },
439
+ {
440
+ id: 'tunnel-street-pedestrian-bicycle',
441
+ type: 'line',
442
+ 'source-layer': 'streets',
443
+ filter: [
444
+ 'all',
445
+ ['==', 'kind', 'pedestrian'],
446
+ ['==', 'bicycle', 'designated'],
447
+ ['==', 'tunnel', true]
448
+ ],
449
+ paint: {
450
+ 'line-color': 'hsl(203,0%,97%)',
451
+ 'line-width': {
452
+ stops: [
453
+ [12, 1],
454
+ [14, 2],
455
+ [16, 5],
456
+ [18, 24],
457
+ [19, 60],
458
+ [20, 120]
459
+ ]
460
+ },
461
+ 'line-opacity': {
462
+ stops: [
463
+ [12, 0],
464
+ [13, 1]
465
+ ]
466
+ }
467
+ },
468
+ layout: street_layout
469
+ },
470
+ {
471
+ id: 'tunnel-street-service-bicycle',
472
+ type: 'line',
473
+ 'source-layer': 'streets',
474
+ filter: [
475
+ 'all',
476
+ ['==', 'kind', 'service'],
477
+ ['==', 'bicycle', 'designated'],
478
+ ['==', 'tunnel', true],
479
+ ['!=', 'service', 'driveway']
480
+ ],
481
+ paint: {
482
+ 'line-color': 'rgb(247,247,247)'
483
+ },
484
+ layout: {
485
+ 'line-join': 'round',
486
+ 'line-cap': 'round'
487
+ }
488
+ }
489
+ ].map((el) => {
490
+ return { source: 'versatiles-osm', ...el } as Layer;
491
+ });
492
+
493
+ const walkingSurface: Layer[] = [
494
+ {
495
+ id: 'street-pedestrian-zone',
496
+ type: 'fill',
497
+ 'source-layer': 'street_polygons',
498
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['==', 'kind', 'pedestrian']],
499
+ paint: {
500
+ 'fill-color': 'rgba(245,245,245,0.25)',
501
+ 'fill-opacity': {
502
+ stops: [
503
+ [12, 0],
504
+ [13, 1],
505
+ [14, 0],
506
+ [15, 1]
507
+ ]
508
+ }
509
+ }
510
+ },
511
+ {
512
+ id: 'way-footway:outline',
513
+ type: 'line',
514
+ 'source-layer': 'streets',
515
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'footway']],
516
+ layout: {
517
+ 'line-cap': 'round'
518
+ },
519
+ paint: {
520
+ 'line-width': {
521
+ stops: [
522
+ [15, 0],
523
+ [16, 5],
524
+ [18, 7],
525
+ [19, 12],
526
+ [20, 22]
527
+ ]
528
+ },
529
+ 'line-color': 'rgb(220,220,220)'
530
+ },
531
+ minzoom: 15
532
+ },
533
+ {
534
+ id: 'way-steps:outline',
535
+ type: 'line',
536
+ 'source-layer': 'streets',
537
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'steps']],
538
+ minzoom: 15,
539
+ layout: {
540
+ 'line-cap': 'round'
541
+ },
542
+ paint: {
543
+ 'line-width': {
544
+ stops: [
545
+ [15, 0],
546
+ [16, 5],
547
+ [18, 7],
548
+ [19, 12],
549
+ [20, 22]
550
+ ]
551
+ },
552
+ 'line-color': 'rgb(220,220,220)'
553
+ }
554
+ },
555
+ {
556
+ id: 'way-path:outline',
557
+ type: 'line',
558
+ 'source-layer': 'streets',
559
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'path']],
560
+ minzoom: 15,
561
+ layout: {
562
+ 'line-cap': 'round'
563
+ },
564
+ paint: {
565
+ 'line-width': {
566
+ stops: [
567
+ [15, 0],
568
+ [16, 5],
569
+ [18, 7],
570
+ [19, 12],
571
+ [20, 22]
572
+ ]
573
+ },
574
+ 'line-color': 'rgb(220,220,220)'
575
+ }
576
+ },
577
+ {
578
+ id: 'way-cycleway:outline',
579
+ type: 'line',
580
+ 'source-layer': 'streets',
581
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'cycleway']],
582
+ layout: {
583
+ 'line-cap': 'round'
584
+ },
585
+ paint: {
586
+ 'line-width': {
587
+ stops: [
588
+ [15, 0],
589
+ [16, 5],
590
+ [18, 7],
591
+ [19, 12],
592
+ [20, 22]
593
+ ]
594
+ },
595
+ 'line-color': 'rgb(222,222,222)'
596
+ },
597
+ minzoom: 15
598
+ },
599
+ {
600
+ id: 'street-track:outline',
601
+ type: 'line',
602
+ 'source-layer': 'streets',
603
+ filter: ['all', ['==', 'kind', 'track'], ['!=', 'bridge', true], ['!=', 'tunnel', true]],
604
+ paint: {
605
+ 'line-color': 'hsl(36,0%,80%)',
606
+ 'line-width': {
607
+ stops: [
608
+ [14, 2],
609
+ [16, 4],
610
+ [18, 18],
611
+ [19, 48],
612
+ [20, 96]
613
+ ]
614
+ },
615
+ 'line-opacity': {
616
+ stops: [
617
+ [14, 0],
618
+ [15, 1]
619
+ ]
620
+ }
621
+ },
622
+ layout: {
623
+ 'line-join': 'round',
624
+ 'line-cap': 'round'
625
+ }
626
+ },
627
+ {
628
+ id: 'street-pedestrian:outline',
629
+ type: 'line',
630
+ 'source-layer': 'streets',
631
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['!=', 'bridge', true], ['!=', 'tunnel', true]],
632
+ paint: {
633
+ 'line-color': 'hsl(36,0%,80%)',
634
+ 'line-width': {
635
+ stops: [
636
+ [12, 2],
637
+ [14, 3],
638
+ [16, 6],
639
+ [18, 26],
640
+ [19, 64],
641
+ [20, 128]
642
+ ]
643
+ },
644
+ 'line-opacity': {
645
+ stops: [
646
+ [12, 0],
647
+ [13, 1]
648
+ ]
649
+ }
650
+ },
651
+ layout: {
652
+ 'line-join': 'round',
653
+ 'line-cap': 'round'
654
+ }
655
+ },
656
+ {
657
+ id: 'way-footway',
658
+ type: 'line',
659
+ 'source-layer': 'streets',
660
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'footway']],
661
+ layout: {
662
+ 'line-cap': 'round'
663
+ },
664
+ paint: {
665
+ 'line-width': {
666
+ stops: [
667
+ [15, 0],
668
+ [16, 4],
669
+ [18, 6],
670
+ [19, 10],
671
+ [20, 20]
672
+ ]
673
+ },
674
+ 'line-color': 'rgb(245,245,245)'
675
+ },
676
+ minzoom: 15
677
+ },
678
+ {
679
+ id: 'way-steps',
680
+ type: 'line',
681
+ 'source-layer': 'streets',
682
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'steps']],
683
+ layout: {
684
+ 'line-cap': 'round'
685
+ },
686
+ paint: {
687
+ 'line-width': {
688
+ stops: [
689
+ [15, 0],
690
+ [16, 4],
691
+ [18, 6],
692
+ [19, 10],
693
+ [20, 20]
694
+ ]
695
+ },
696
+ 'line-color': 'rgb(245,245,245)'
697
+ },
698
+ minzoom: 15
699
+ },
700
+ {
701
+ id: 'way-path',
702
+ type: 'line',
703
+ 'source-layer': 'streets',
704
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'path']],
705
+ layout: {
706
+ 'line-cap': 'round'
707
+ },
708
+ paint: {
709
+ 'line-width': {
710
+ stops: [
711
+ [15, 0],
712
+ [16, 4],
713
+ [18, 6],
714
+ [19, 10],
715
+ [20, 20]
716
+ ]
717
+ },
718
+ 'line-color': 'rgb(245,245,245)'
719
+ },
720
+ minzoom: 15
721
+ },
722
+ {
723
+ id: 'way-cycleway',
724
+ type: 'line',
725
+ 'source-layer': 'streets',
726
+ filter: ['all', ['!=', 'bridge', true], ['!=', 'tunnel', true], ['in', 'kind', 'cycleway']],
727
+ layout: {
728
+ 'line-cap': 'round'
729
+ },
730
+ paint: {
731
+ 'line-width': {
732
+ stops: [
733
+ [15, 0],
734
+ [16, 4],
735
+ [18, 6],
736
+ [19, 10],
737
+ [20, 20]
738
+ ]
739
+ },
740
+ 'line-color': 'hsl(203,0%,97%)'
741
+ },
742
+ minzoom: 15
743
+ },
744
+ {
745
+ id: 'street-track',
746
+ type: 'line',
747
+ 'source-layer': 'streets',
748
+ filter: ['all', ['==', 'kind', 'track'], ['!=', 'bridge', true], ['!=', 'tunnel', true]],
749
+ paint: {
750
+ 'line-color': 'hsl(0,0%,100%)',
751
+ 'line-width': {
752
+ stops: [
753
+ [14, 1],
754
+ [16, 3],
755
+ [18, 16],
756
+ [19, 44],
757
+ [20, 88]
758
+ ]
759
+ },
760
+ 'line-opacity': {
761
+ stops: [
762
+ [14, 0],
763
+ [15, 1]
764
+ ]
765
+ }
766
+ },
767
+ layout: {
768
+ 'line-join': 'round',
769
+ 'line-cap': 'round'
770
+ }
771
+ },
772
+ {
773
+ id: 'street-pedestrian',
774
+ type: 'line',
775
+ 'source-layer': 'streets',
776
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['!=', 'bridge', true], ['!=', 'tunnel', true]],
777
+ paint: {
778
+ 'line-color': tokens.street_tertiary,
779
+ 'line-width': {
780
+ stops: [
781
+ [12, 1],
782
+ [14, 2],
783
+ [16, 5],
784
+ [18, 24],
785
+ [19, 60],
786
+ [20, 120]
787
+ ]
788
+ },
789
+ 'line-opacity': {
790
+ stops: [
791
+ [12, 0],
792
+ [13, 0],
793
+ [14, 1]
794
+ ]
795
+ }
796
+ },
797
+ layout: {
798
+ 'line-join': 'round',
799
+ 'line-cap': 'round'
800
+ }
801
+ },
802
+ {
803
+ id: 'street-track-bicycle',
804
+ type: 'line',
805
+ 'source-layer': 'streets',
806
+ filter: [
807
+ 'all',
808
+ ['==', 'kind', 'track'],
809
+ ['==', 'bicycle', 'designated'],
810
+ ['!=', 'bridge', true],
811
+ ['!=', 'tunnel', true]
812
+ ],
813
+ paint: {
814
+ 'line-color': 'hsl(0,0%,100%)'
815
+ },
816
+ layout: {
817
+ 'line-join': 'round',
818
+ 'line-cap': 'round'
819
+ }
820
+ },
821
+ {
822
+ id: 'street-pedestrian-bicycle',
823
+ type: 'line',
824
+ 'source-layer': 'streets',
825
+ filter: [
826
+ 'all',
827
+ ['==', 'kind', 'pedestrian'],
828
+ ['==', 'bicycle', 'designated'],
829
+ ['!=', 'bridge', true],
830
+ ['!=', 'tunnel', true]
831
+ ],
832
+ paint: {
833
+ 'line-color': 'hsl(203,0%,97%)',
834
+ 'line-width': {
835
+ stops: [
836
+ [12, 1],
837
+ [14, 2],
838
+ [16, 5],
839
+ [18, 24],
840
+ [19, 60],
841
+ [20, 120]
842
+ ]
843
+ },
844
+ 'line-opacity': {
845
+ stops: [
846
+ [12, 0],
847
+ [13, 1]
848
+ ]
849
+ }
850
+ },
851
+ layout: street_layout
852
+ },
853
+ {
854
+ id: 'street-service-bicycle',
855
+ type: 'line',
856
+ 'source-layer': 'streets',
857
+ filter: [
858
+ 'all',
859
+ ['==', 'kind', 'service'],
860
+ ['==', 'bicycle', 'designated'],
861
+ ['!=', 'bridge', true],
862
+ ['!=', 'tunnel', true],
863
+ ['!=', 'service', 'driveway']
864
+ ],
865
+ paint: {
866
+ 'line-color': 'hsl(0,0%,100%)'
867
+ },
868
+ layout: {
869
+ 'line-join': 'round',
870
+ 'line-cap': 'round'
871
+ }
872
+ },
873
+ {
874
+ id: 'street-livingstreet-bicycle',
875
+ type: 'line',
876
+ 'source-layer': 'streets',
877
+ filter: [
878
+ 'all',
879
+ ['==', 'kind', 'living_street'],
880
+ ['==', 'bicycle', 'designated'],
881
+ ['!=', 'bridge', true],
882
+ ['!=', 'tunnel', true]
883
+ ],
884
+ paint: {
885
+ 'line-color': 'hsl(203,0%,97%)',
886
+ 'line-width': {
887
+ stops: [
888
+ [12, 1],
889
+ [14, 2],
890
+ [16, 5],
891
+ [18, 24],
892
+ [19, 60],
893
+ [20, 120]
894
+ ]
895
+ },
896
+ 'line-opacity': {
897
+ stops: [
898
+ [12, 0],
899
+ [13, 1]
900
+ ]
901
+ }
902
+ },
903
+ layout: street_layout
904
+ },
905
+ {
906
+ id: 'street-residential-bicycle',
907
+ type: 'line',
908
+ 'source-layer': 'streets',
909
+ filter: [
910
+ 'all',
911
+ ['==', 'kind', 'residential'],
912
+ ['==', 'bicycle', 'designated'],
913
+ ['!=', 'bridge', true],
914
+ ['!=', 'tunnel', true]
915
+ ],
916
+ paint: {
917
+ 'line-color': street_residential.line_color,
918
+ 'line-width': street_residential.line_width,
919
+ 'line-opacity': street_residential.line_opacity
920
+ },
921
+ layout: street_layout
922
+ },
923
+ {
924
+ id: 'street-unclassified-bicycle',
925
+ type: 'line',
926
+ 'source-layer': 'streets',
927
+ filter: [
928
+ 'all',
929
+ ['==', 'kind', 'unclassified'],
930
+ ['==', 'bicycle', 'designated'],
931
+ ['!=', 'bridge', true],
932
+ ['!=', 'tunnel', true]
933
+ ],
934
+ paint: {
935
+ 'line-color': 'hsl(203,0%,97%)',
936
+ 'line-width': {
937
+ stops: [
938
+ [12, 1],
939
+ [14, 2],
940
+ [16, 5],
941
+ [18, 24],
942
+ [19, 60],
943
+ [20, 120]
944
+ ]
945
+ },
946
+ 'line-opacity': {
947
+ stops: [
948
+ [12, 0],
949
+ [13, 1]
950
+ ]
951
+ }
952
+ },
953
+ layout: street_layout
954
+ }
955
+ ].map((el) => {
956
+ return { source: 'versatiles-osm', ...el } as Layer;
957
+ });
958
+
959
+ const walkingBridges: Layer[] = [
960
+ {
961
+ id: 'bridge-way-footway:bridge',
962
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'footway']],
963
+ layout: {
964
+ 'line-cap': 'butt',
965
+ 'line-join': 'round'
966
+ },
967
+ paint: {
968
+ 'line-color': 'rgb(239,239,239)',
969
+ 'line-opacity': 0.5,
970
+ 'line-width': {
971
+ stops: [
972
+ [15, 0],
973
+ [16, 7],
974
+ [18, 10],
975
+ [19, 17],
976
+ [20, 31]
977
+ ]
978
+ }
979
+ },
980
+ minzoom: 15
981
+ },
982
+ {
983
+ id: 'bridge-way-steps:bridge',
984
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'steps']],
985
+ layout: {
986
+ 'line-cap': 'butt',
987
+ 'line-join': 'round'
988
+ },
989
+ paint: {
990
+ 'line-color': 'rgb(239,239,239)',
991
+ 'line-opacity': 0.5,
992
+ 'line-width': {
993
+ stops: [
994
+ [15, 0],
995
+ [16, 7],
996
+ [18, 10],
997
+ [19, 17],
998
+ [20, 31]
999
+ ]
1000
+ }
1001
+ },
1002
+ minzoom: 15
1003
+ },
1004
+ {
1005
+ id: 'bridge-way-path:bridge',
1006
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'path']],
1007
+ layout: {
1008
+ 'line-cap': 'butt',
1009
+ 'line-join': 'round'
1010
+ },
1011
+ paint: {
1012
+ 'line-color': 'rgb(239,239,239)',
1013
+ 'line-opacity': 0.5,
1014
+ 'line-width': {
1015
+ stops: [
1016
+ [15, 0],
1017
+ [16, 7],
1018
+ [18, 10],
1019
+ [19, 17],
1020
+ [20, 31]
1021
+ ]
1022
+ }
1023
+ },
1024
+ minzoom: 15
1025
+ },
1026
+ {
1027
+ id: 'bridge-way-cycleway:bridge',
1028
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'cycleway']],
1029
+ layout: {
1030
+ 'line-cap': 'butt',
1031
+ 'line-join': 'round'
1032
+ },
1033
+ paint: {
1034
+ 'line-color': 'rgb(239,239,239)',
1035
+ 'line-opacity': 0.5,
1036
+ 'line-width': {
1037
+ stops: [
1038
+ [15, 0],
1039
+ [16, 7],
1040
+ [18, 10],
1041
+ [19, 17],
1042
+ [20, 31]
1043
+ ]
1044
+ }
1045
+ },
1046
+ minzoom: 15
1047
+ },
1048
+ {
1049
+ id: 'bridge-street-track:bridge',
1050
+ filter: ['all', ['==', 'kind', 'track'], ['==', 'bridge', true]],
1051
+ layout: {
1052
+ 'line-cap': 'butt',
1053
+ 'line-join': 'round'
1054
+ },
1055
+ paint: {
1056
+ 'line-color': 'rgb(239,239,239)',
1057
+ 'line-opacity': {
1058
+ stops: [
1059
+ [14, 0],
1060
+ [15, 1]
1061
+ ]
1062
+ },
1063
+ 'line-width': {
1064
+ stops: [
1065
+ [14, 3],
1066
+ [16, 6],
1067
+ [18, 25],
1068
+ [19, 67],
1069
+ [20, 134]
1070
+ ]
1071
+ }
1072
+ }
1073
+ },
1074
+ {
1075
+ id: 'bridge-street-pedestrian:bridge',
1076
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['==', 'bridge', true]],
1077
+ layout: {
1078
+ 'line-cap': 'butt',
1079
+ 'line-join': 'round'
1080
+ },
1081
+ paint: {
1082
+ 'line-color': 'rgb(239,239,239)',
1083
+ 'line-opacity': {
1084
+ stops: [
1085
+ [12, 0],
1086
+ [13, 1]
1087
+ ]
1088
+ },
1089
+ 'line-width': {
1090
+ stops: [
1091
+ [12, 3],
1092
+ [14, 4],
1093
+ [16, 8],
1094
+ [18, 36],
1095
+ [19, 90],
1096
+ [20, 179]
1097
+ ]
1098
+ }
1099
+ }
1100
+ },
1101
+ {
1102
+ id: 'bridge-street-pedestrian-zone',
1103
+ type: 'fill',
1104
+ 'source-layer': 'street_polygons',
1105
+ filter: ['all', ['==', 'bridge', true], ['==', 'kind', 'pedestrian']],
1106
+ paint: {
1107
+ 'fill-color': 'hsl(0,0%,100%)',
1108
+ 'fill-opacity': {
1109
+ stops: [
1110
+ [12, 0],
1111
+ [13, 1]
1112
+ ]
1113
+ }
1114
+ }
1115
+ },
1116
+ {
1117
+ id: 'bridge-way-footway:outline',
1118
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'footway']],
1119
+ minzoom: 15,
1120
+ layout: {
1121
+ 'line-cap': 'butt'
1122
+ },
1123
+ paint: {
1124
+ 'line-width': {
1125
+ stops: [
1126
+ [15, 0],
1127
+ [16, 5],
1128
+ [18, 7],
1129
+ [19, 12],
1130
+ [20, 22]
1131
+ ]
1132
+ },
1133
+ 'line-color': 'rgb(220,220,220)'
1134
+ }
1135
+ },
1136
+ {
1137
+ id: 'bridge-way-steps:outline',
1138
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'steps']],
1139
+ minzoom: 15,
1140
+ layout: {
1141
+ 'line-cap': 'butt'
1142
+ },
1143
+ paint: {
1144
+ 'line-width': {
1145
+ stops: [
1146
+ [15, 0],
1147
+ [16, 5],
1148
+ [18, 7],
1149
+ [19, 12],
1150
+ [20, 22]
1151
+ ]
1152
+ },
1153
+ 'line-color': 'rgb(220,220,220)'
1154
+ }
1155
+ },
1156
+ {
1157
+ id: 'bridge-way-path:outline',
1158
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'path']],
1159
+ layout: {
1160
+ 'line-cap': 'butt'
1161
+ },
1162
+ paint: {
1163
+ 'line-width': {
1164
+ stops: [
1165
+ [15, 0],
1166
+ [16, 5],
1167
+ [18, 7],
1168
+ [19, 12],
1169
+ [20, 22]
1170
+ ]
1171
+ },
1172
+ 'line-color': 'rgb(220,220,220)'
1173
+ },
1174
+ minzoom: 15
1175
+ },
1176
+ {
1177
+ id: 'bridge-way-cycleway:outline',
1178
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'cycleway']],
1179
+ layout: {
1180
+ 'line-cap': 'butt'
1181
+ },
1182
+ paint: {
1183
+ 'line-width': {
1184
+ stops: [
1185
+ [15, 0],
1186
+ [16, 5],
1187
+ [18, 7],
1188
+ [19, 12],
1189
+ [20, 22]
1190
+ ]
1191
+ },
1192
+ 'line-color': 'rgb(222,222,222)'
1193
+ },
1194
+ minzoom: 15
1195
+ },
1196
+ {
1197
+ id: 'bridge-street-track:outline',
1198
+ filter: ['all', ['==', 'kind', 'track'], ['==', 'bridge', true]],
1199
+ paint: {
1200
+ 'line-color': 'rgb(217,217,217)',
1201
+ 'line-width': {
1202
+ stops: [
1203
+ [14, 2],
1204
+ [16, 4],
1205
+ [18, 18],
1206
+ [19, 48],
1207
+ [20, 96]
1208
+ ]
1209
+ },
1210
+ 'line-opacity': {
1211
+ stops: [
1212
+ [14, 0],
1213
+ [15, 1]
1214
+ ]
1215
+ }
1216
+ },
1217
+ layout: street_layout
1218
+ },
1219
+ {
1220
+ id: 'bridge-street-pedestrian:outline',
1221
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['==', 'bridge', true]],
1222
+ paint: {
1223
+ 'line-color': 'rgb(217,217,217)',
1224
+ 'line-width': {
1225
+ stops: [
1226
+ [12, 2],
1227
+ [14, 3],
1228
+ [16, 6],
1229
+ [18, 26],
1230
+ [19, 64],
1231
+ [20, 128]
1232
+ ]
1233
+ },
1234
+ 'line-opacity': {
1235
+ stops: [
1236
+ [12, 0],
1237
+ [13, 1]
1238
+ ]
1239
+ }
1240
+ },
1241
+ layout: street_layout
1242
+ },
1243
+ {
1244
+ id: 'bridge-way-footway',
1245
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'footway']],
1246
+ layout: {
1247
+ 'line-cap': 'butt'
1248
+ },
1249
+ paint: {
1250
+ 'line-width': {
1251
+ stops: [
1252
+ [15, 0],
1253
+ [16, 4],
1254
+ [18, 6],
1255
+ [19, 10],
1256
+ [20, 20]
1257
+ ]
1258
+ },
1259
+ 'line-color': 'rgb(245,245,245)'
1260
+ },
1261
+ minzoom: 15
1262
+ },
1263
+ {
1264
+ id: 'bridge-way-steps',
1265
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'steps']],
1266
+ layout: {
1267
+ 'line-cap': 'butt'
1268
+ },
1269
+ paint: {
1270
+ 'line-width': {
1271
+ stops: [
1272
+ [15, 0],
1273
+ [16, 4],
1274
+ [18, 6],
1275
+ [19, 10],
1276
+ [20, 20]
1277
+ ]
1278
+ },
1279
+ 'line-color': 'rgb(245,245,245)'
1280
+ },
1281
+ minzoom: 15
1282
+ },
1283
+ {
1284
+ id: 'bridge-way-path',
1285
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'path']],
1286
+ layout: {
1287
+ 'line-cap': 'butt'
1288
+ },
1289
+ paint: {
1290
+ 'line-width': {
1291
+ stops: [
1292
+ [15, 0],
1293
+ [16, 4],
1294
+ [18, 6],
1295
+ [19, 10],
1296
+ [20, 20]
1297
+ ]
1298
+ },
1299
+ 'line-color': 'rgb(245,245,245)'
1300
+ },
1301
+ minzoom: 15
1302
+ },
1303
+ {
1304
+ id: 'bridge-way-cycleway',
1305
+ filter: ['all', ['==', 'bridge', true], ['in', 'kind', 'cycleway']],
1306
+ layout: {
1307
+ 'line-cap': 'butt'
1308
+ },
1309
+ paint: {
1310
+ 'line-width': {
1311
+ stops: [
1312
+ [15, 0],
1313
+ [16, 4],
1314
+ [18, 6],
1315
+ [19, 10],
1316
+ [20, 20]
1317
+ ]
1318
+ },
1319
+ 'line-color': 'hsl(203,0%,97%)'
1320
+ },
1321
+ minzoom: 15
1322
+ },
1323
+ {
1324
+ id: 'bridge-street-track',
1325
+ filter: ['all', ['==', 'kind', 'track'], ['==', 'bridge', true]],
1326
+ paint: {
1327
+ 'line-color': 'hsl(0,0%,100%)',
1328
+ 'line-width': {
1329
+ stops: [
1330
+ [14, 1],
1331
+ [16, 3],
1332
+ [18, 16],
1333
+ [19, 44],
1334
+ [20, 88]
1335
+ ]
1336
+ },
1337
+ 'line-opacity': {
1338
+ stops: [
1339
+ [14, 0],
1340
+ [15, 1]
1341
+ ]
1342
+ }
1343
+ },
1344
+ layout: street_layout
1345
+ },
1346
+ {
1347
+ id: 'bridge-street-pedestrian',
1348
+ filter: ['all', ['==', 'kind', 'pedestrian'], ['==', 'bridge', true]],
1349
+ paint: {
1350
+ 'line-color': 'hsl(0,0%,100%)',
1351
+ 'line-width': {
1352
+ stops: [
1353
+ [12, 1],
1354
+ [14, 2],
1355
+ [16, 5],
1356
+ [18, 24],
1357
+ [19, 60],
1358
+ [20, 120]
1359
+ ]
1360
+ },
1361
+ 'line-opacity': {
1362
+ stops: [
1363
+ [12, 0],
1364
+ [13, 1]
1365
+ ]
1366
+ }
1367
+ },
1368
+ layout: street_layout
1369
+ },
1370
+ {
1371
+ id: 'bridge-street-track-bicycle',
1372
+ filter: [
1373
+ 'all',
1374
+ ['==', 'kind', 'track'],
1375
+ ['==', 'bicycle', 'designated'],
1376
+ ['==', 'bridge', true]
1377
+ ],
1378
+ paint: {
1379
+ 'line-color': 'hsl(0,0%,100%)'
1380
+ },
1381
+ layout: street_layout
1382
+ },
1383
+ {
1384
+ id: 'bridge-street-pedestrian-bicycle',
1385
+ filter: [
1386
+ 'all',
1387
+ ['==', 'kind', 'pedestrian'],
1388
+ ['==', 'bicycle', 'designated'],
1389
+ ['==', 'bridge', true]
1390
+ ],
1391
+ paint: {
1392
+ 'line-color': 'hsl(203,0%,97%)',
1393
+ 'line-width': {
1394
+ stops: [
1395
+ [12, 1],
1396
+ [14, 2],
1397
+ [16, 5],
1398
+ [18, 24],
1399
+ [19, 60],
1400
+ [20, 120]
1401
+ ]
1402
+ },
1403
+ 'line-opacity': {
1404
+ stops: [
1405
+ [12, 0],
1406
+ [13, 1]
1407
+ ]
1408
+ }
1409
+ },
1410
+ layout: street_layout
1411
+ },
1412
+ {
1413
+ id: 'bridge-street-service-bicycle',
1414
+ filter: [
1415
+ 'all',
1416
+ ['==', 'kind', 'service'],
1417
+ ['==', 'bicycle', 'designated'],
1418
+ ['==', 'bridge', true],
1419
+ ['!=', 'service', 'driveway']
1420
+ ],
1421
+ paint: {
1422
+ 'line-color': 'hsl(0,0%,100%)'
1423
+ },
1424
+ layout: street_layout
1425
+ },
1426
+ {
1427
+ id: 'bridge-street-livingstreet-bicycle',
1428
+ filter: [
1429
+ 'all',
1430
+ ['==', 'kind', 'living_street'],
1431
+ ['==', 'bicycle', 'designated'],
1432
+ ['==', 'bridge', true]
1433
+ ],
1434
+ paint: {
1435
+ 'line-color': 'hsl(203,0%,97%)',
1436
+ 'line-width': {
1437
+ stops: [
1438
+ [12, 1],
1439
+ [14, 2],
1440
+ [16, 5],
1441
+ [18, 24],
1442
+ [19, 60],
1443
+ [20, 120]
1444
+ ]
1445
+ },
1446
+ 'line-opacity': {
1447
+ stops: [
1448
+ [12, 0],
1449
+ [13, 1]
1450
+ ]
1451
+ }
1452
+ },
1453
+ layout: street_layout
1454
+ },
1455
+ {
1456
+ id: 'bridge-street-residential-bicycle',
1457
+ filter: [
1458
+ 'all',
1459
+ ['==', 'kind', 'residential'],
1460
+ ['==', 'bicycle', 'designated'],
1461
+ ['==', 'bridge', true]
1462
+ ],
1463
+ paint: {
1464
+ 'line-color': street_residential.line_color,
1465
+ 'line-width': street_residential.line_width,
1466
+ 'line-opacity': street_residential.line_opacity
1467
+ },
1468
+ layout: street_layout
1469
+ },
1470
+ {
1471
+ id: 'bridge-street-unclassified-bicycle',
1472
+ filter: [
1473
+ 'all',
1474
+ ['==', 'kind', 'unclassified'],
1475
+ ['==', 'bicycle', 'designated'],
1476
+ ['==', 'bridge', true]
1477
+ ],
1478
+ paint: {
1479
+ 'line-color': 'hsl(203,0%,97%)',
1480
+ 'line-width': {
1481
+ stops: [
1482
+ [12, 1],
1483
+ [14, 2],
1484
+ [16, 5],
1485
+ [18, 24],
1486
+ [19, 60],
1487
+ [20, 120]
1488
+ ]
1489
+ },
1490
+ 'line-opacity': {
1491
+ stops: [
1492
+ [12, 0],
1493
+ [13, 1]
1494
+ ]
1495
+ }
1496
+ },
1497
+ layout: street_layout
1498
+ }
1499
+ ].map((el) => {
1500
+ return {
1501
+ type: 'line',
1502
+ 'source-layer': 'streets',
1503
+ source: 'versatiles-osm',
1504
+ ...el
1505
+ } as Layer;
1506
+ });
1507
+
1508
+ const walkingLabels: SymbolLayerSpecification[] = [
1509
+ {
1510
+ source: 'versatiles-osm',
1511
+ id: 'label-street-pedestrian',
1512
+ type: 'symbol',
1513
+ 'source-layer': 'street_labels',
1514
+ filter: ['==', 'kind', 'pedestrian'],
1515
+ minzoom: 14,
1516
+ layout: {
1517
+ 'text-field': '{name_de}',
1518
+ 'text-font': tokens.sans_regular,
1519
+ 'symbol-placement': 'line',
1520
+ 'text-anchor': 'center',
1521
+ 'text-size': {
1522
+ stops: [
1523
+ [12, 10],
1524
+ [15, 13]
1525
+ ]
1526
+ }
1527
+ },
1528
+ paint: {
1529
+ 'text-color': 'hsl(240,0%,23%)',
1530
+ 'text-halo-color': 'hsla(0,0%,100%,0.8)',
1531
+ 'text-halo-width': 2,
1532
+ 'text-halo-blur': 1
1533
+ }
1534
+ }
1535
+ ];
1536
+
1537
+ return { walkingTunnels, walkingSurface, walkingBridges, walkingLabels };
1538
+ }