@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,499 @@
1
+ import tokens from '../tokens';
2
+ import { type Layer } from '../../types';
3
+
4
+ export default function makeLanduse(): any {
5
+ const landuse: Layer[] = [
6
+ {
7
+ id: 'background',
8
+ type: 'background',
9
+ paint: {
10
+ 'background-color': tokens.background
11
+ }
12
+ },
13
+ {
14
+ id: 'water-ocean',
15
+ type: 'fill',
16
+ 'source-layer': 'ocean',
17
+ paint: {
18
+ 'fill-color': 'hsl(219, 56%, 93%)'
19
+ }
20
+ },
21
+ {
22
+ id: 'land-glacier',
23
+ type: 'fill',
24
+ 'source-layer': 'water_polygons',
25
+ filter: ['all', ['==', 'kind', 'glacier']],
26
+ paint: {
27
+ 'fill-color': 'hsl(0,0%,100%)'
28
+ }
29
+ },
30
+ {
31
+ id: 'land-agriculture',
32
+ type: 'fill',
33
+ 'source-layer': 'land',
34
+ filter: [
35
+ 'all',
36
+ [
37
+ 'in',
38
+ 'kind',
39
+ 'brownfield',
40
+ 'farmland',
41
+ 'farmyard',
42
+ 'greenfield',
43
+ 'greenhouse_horticulture',
44
+ 'orchard',
45
+ 'plant_nursery',
46
+ 'vineyard'
47
+ ]
48
+ ],
49
+ paint: {
50
+ 'fill-color': tokens.grass,
51
+ 'fill-opacity': {
52
+ stops: [
53
+ [11, 0],
54
+ [12, 1]
55
+ ]
56
+ }
57
+ }
58
+ },
59
+ {
60
+ id: 'land-waste',
61
+ type: 'fill',
62
+ 'source-layer': 'land',
63
+ filter: ['all', ['in', 'kind', 'landfill']],
64
+ paint: {
65
+ 'fill-color': 'hsl(50,0%,95%)',
66
+ 'fill-opacity': {
67
+ stops: [
68
+ [10, 0],
69
+ [11, 1]
70
+ ]
71
+ }
72
+ }
73
+ },
74
+ {
75
+ id: 'land-park',
76
+ type: 'fill',
77
+ 'source-layer': 'land',
78
+ filter: ['all', ['in', 'kind', 'park', 'village_green', 'recreation_ground']],
79
+ paint: {
80
+ 'fill-color': tokens.grass,
81
+ 'fill-opacity': {
82
+ stops: [
83
+ [11, 0],
84
+ [12, 1]
85
+ ]
86
+ }
87
+ }
88
+ },
89
+ {
90
+ id: 'land-garden',
91
+ type: 'fill',
92
+ 'source-layer': 'land',
93
+ filter: ['all', ['in', 'kind', 'allotments', 'garden']],
94
+ paint: {
95
+ 'fill-color': tokens.grass,
96
+ 'fill-opacity': {
97
+ stops: [
98
+ [14, 0],
99
+ [15, 1]
100
+ ]
101
+ }
102
+ }
103
+ },
104
+ {
105
+ id: 'land-burial',
106
+ type: 'fill',
107
+ 'source-layer': 'land',
108
+ filter: ['all', ['in', 'kind', 'cemetery', 'grave_yard']],
109
+ paint: {
110
+ 'fill-color': tokens.grass,
111
+ 'fill-opacity': {
112
+ stops: [
113
+ [12, 0],
114
+ [13, 1]
115
+ ]
116
+ }
117
+ }
118
+ },
119
+ {
120
+ id: 'land-leisure',
121
+ type: 'fill',
122
+ 'source-layer': 'land',
123
+ filter: ['all', ['in', 'kind', 'miniature_golf', 'playground', 'golf_course']],
124
+ paint: {
125
+ 'fill-color': tokens.grass_dark
126
+ }
127
+ },
128
+ {
129
+ id: 'land-rock',
130
+ type: 'fill',
131
+ 'source-layer': 'land',
132
+ filter: ['all', ['in', 'kind', 'bare_rock', 'scree', 'shingle']],
133
+ paint: {
134
+ 'fill-color': 'hsl(192,0%,90%)'
135
+ }
136
+ },
137
+ {
138
+ id: 'land-forest',
139
+ type: 'fill',
140
+ 'source-layer': 'land',
141
+ filter: ['all', ['in', 'kind', 'forest']],
142
+ paint: {
143
+ 'fill-color': tokens.grass,
144
+ 'fill-opacity': {
145
+ stops: [
146
+ [12, 0],
147
+ [13, 0.25]
148
+ ]
149
+ }
150
+ }
151
+ },
152
+ {
153
+ id: 'land-grass',
154
+ type: 'fill',
155
+ 'source-layer': 'land',
156
+ filter: ['all', ['in', 'kind', 'grass', 'grassland', 'meadow', 'wet_meadow']],
157
+ paint: {
158
+ 'fill-color': tokens.grass,
159
+ 'fill-opacity': {
160
+ stops: [
161
+ [11, 0],
162
+ [12, 1]
163
+ ]
164
+ }
165
+ }
166
+ },
167
+ {
168
+ id: 'land-vegetation',
169
+ type: 'fill',
170
+ 'source-layer': 'land',
171
+ filter: ['all', ['in', 'kind', 'heath', 'scrub']],
172
+ paint: {
173
+ 'fill-color': tokens.grass,
174
+ 'fill-opacity': {
175
+ stops: [
176
+ [11, 0],
177
+ [12, 1]
178
+ ]
179
+ }
180
+ }
181
+ },
182
+ {
183
+ id: 'land-sand',
184
+ type: 'fill',
185
+ 'source-layer': 'land',
186
+ filter: ['all', ['in', 'kind', 'beach', 'sand']],
187
+ paint: {
188
+ 'fill-color': 'hsl(60,0%,95%)'
189
+ }
190
+ },
191
+ {
192
+ id: 'land-wetland',
193
+ type: 'fill',
194
+ 'source-layer': 'land',
195
+ filter: ['all', ['in', 'kind', 'bog', 'marsh', 'string_bog', 'swamp']],
196
+ paint: {
197
+ 'fill-color': tokens.marsh,
198
+ 'fill-opacity': {
199
+ stops: [
200
+ [10, 0],
201
+ [11, 1]
202
+ ]
203
+ }
204
+ }
205
+ },
206
+ {
207
+ id: 'water-river',
208
+ type: 'line',
209
+ 'source-layer': 'water_lines',
210
+ filter: ['all', ['in', 'kind', 'river'], ['!=', 'tunnel', true]],
211
+ paint: {
212
+ 'line-color': tokens.water,
213
+ 'line-width': {
214
+ stops: [
215
+ [8, 0],
216
+ [10, 1],
217
+ [12, 2],
218
+ [15, 4],
219
+ [17, 9],
220
+ [18, 20],
221
+ [20, 60]
222
+ ]
223
+ }
224
+ },
225
+ layout: {
226
+ 'line-cap': 'round',
227
+ 'line-join': 'round'
228
+ }
229
+ },
230
+ {
231
+ id: 'water-canal',
232
+ type: 'line',
233
+ 'source-layer': 'water_lines',
234
+ filter: ['all', ['in', 'kind', 'canal'], ['!=', 'tunnel', true], ['!=', 'bridge', true]],
235
+ paint: {
236
+ 'line-color': tokens.water,
237
+ 'line-width': {
238
+ stops: [
239
+ [9, 0],
240
+ [10, 2],
241
+ [15, 3],
242
+ [17, 8],
243
+ [18, 17],
244
+ [20, 50]
245
+ ]
246
+ }
247
+ },
248
+ layout: {
249
+ 'line-cap': 'round',
250
+ 'line-join': 'round'
251
+ }
252
+ },
253
+ {
254
+ id: 'water-stream',
255
+ type: 'line',
256
+ 'source-layer': 'water_lines',
257
+ filter: ['all', ['in', 'kind', 'stream'], ['!=', 'tunnel', true], ['!=', 'bridge', true]],
258
+ paint: {
259
+ 'line-color': tokens.water,
260
+ 'line-width': {
261
+ stops: [
262
+ [13, 0],
263
+ [14, 1],
264
+ [15, 2],
265
+ [17, 6],
266
+ [18, 12],
267
+ [20, 30]
268
+ ]
269
+ }
270
+ },
271
+ layout: {
272
+ 'line-cap': 'round',
273
+ 'line-join': 'round'
274
+ }
275
+ },
276
+ {
277
+ id: 'water-ditch',
278
+ type: 'line',
279
+ 'source-layer': 'water_lines',
280
+ filter: ['all', ['in', 'kind', 'ditch'], ['!=', 'tunnel', true], ['!=', 'bridge', true]],
281
+ paint: {
282
+ 'line-color': tokens.water_light,
283
+ 'line-width': {
284
+ stops: [
285
+ [14, 0],
286
+ [15, 1],
287
+ [17, 4],
288
+ [18, 8],
289
+ [20, 20]
290
+ ]
291
+ }
292
+ },
293
+ layout: {
294
+ 'line-cap': 'round',
295
+ 'line-join': 'round'
296
+ }
297
+ },
298
+ {
299
+ id: 'water-area',
300
+ type: 'fill',
301
+ 'source-layer': 'water_polygons',
302
+ filter: ['==', 'kind', 'water'],
303
+ paint: {
304
+ 'fill-color': tokens.water_light,
305
+ 'fill-opacity': {
306
+ stops: [
307
+ [4, 0],
308
+ [6, 1]
309
+ ]
310
+ }
311
+ }
312
+ },
313
+ {
314
+ id: 'water-area-river',
315
+ type: 'fill',
316
+ 'source-layer': 'water_polygons',
317
+ filter: ['==', 'kind', 'river'],
318
+ paint: {
319
+ 'fill-color': tokens.water,
320
+ 'fill-opacity': {
321
+ stops: [
322
+ [4, 0],
323
+ [6, 1]
324
+ ]
325
+ }
326
+ }
327
+ },
328
+ {
329
+ id: 'water-area-small',
330
+ type: 'fill',
331
+ 'source-layer': 'water_polygons',
332
+ filter: ['in', 'kind', 'reservoir', 'basin', 'dock'],
333
+ paint: {
334
+ 'fill-color': tokens.water,
335
+ 'fill-opacity': {
336
+ stops: [
337
+ [4, 0],
338
+ [6, 1]
339
+ ]
340
+ }
341
+ }
342
+ },
343
+ {
344
+ id: 'water-dam-area',
345
+ type: 'fill',
346
+ 'source-layer': 'dam_polygons',
347
+ filter: ['==', 'kind', 'dam'],
348
+ paint: {
349
+ 'fill-color': 'hsl(33,0%,95%)',
350
+ 'fill-opacity': {
351
+ stops: [
352
+ [12, 0],
353
+ [13, 1]
354
+ ]
355
+ }
356
+ }
357
+ },
358
+ {
359
+ id: 'water-dam',
360
+ type: 'line',
361
+ 'source-layer': 'dam_lines',
362
+ filter: ['==', 'kind', 'dam'],
363
+ paint: {
364
+ 'line-color': 'hsl(205,0%,85%)'
365
+ },
366
+ layout: {
367
+ 'line-cap': 'round',
368
+ 'line-join': 'round'
369
+ }
370
+ },
371
+ {
372
+ id: 'water-pier-area',
373
+ type: 'fill',
374
+ 'source-layer': 'pier_polygons',
375
+ filter: ['in', 'kind', 'pier', 'breakwater', 'groyne'],
376
+ paint: {
377
+ 'fill-color': tokens.street_tertiary,
378
+ 'fill-opacity': {
379
+ stops: [
380
+ [14, 0],
381
+ [15, 1]
382
+ ]
383
+ }
384
+ }
385
+ },
386
+ {
387
+ id: 'water-pier',
388
+ type: 'line',
389
+ 'source-layer': 'pier_lines',
390
+ filter: ['in', 'kind', 'pier', 'breakwater', 'groyne'],
391
+ paint: {
392
+ 'line-color': tokens.street_tertiary,
393
+ 'line-opacity': {
394
+ stops: [
395
+ [14, 0],
396
+ [15, 1]
397
+ ]
398
+ }
399
+ },
400
+ layout: {
401
+ 'line-cap': 'round',
402
+ 'line-join': 'round'
403
+ }
404
+ },
405
+ {
406
+ id: 'site-dangerarea',
407
+ type: 'fill',
408
+ 'source-layer': 'sites',
409
+ filter: ['in', 'kind', 'danger_area'],
410
+ paint: {
411
+ 'fill-color': 'hsl(0,0%,50%)',
412
+ 'fill-outline-color': 'hsl(0,0%,50%)',
413
+ 'fill-opacity': 0.3
414
+ }
415
+ },
416
+ {
417
+ id: 'site-university',
418
+ type: 'fill',
419
+ 'source-layer': 'sites',
420
+ filter: ['in', 'kind', 'university'],
421
+ paint: {
422
+ 'fill-color': 'hsl(60,0%,75%)',
423
+ 'fill-opacity': 0.1
424
+ }
425
+ },
426
+ {
427
+ id: 'site-college',
428
+ type: 'fill',
429
+ 'source-layer': 'sites',
430
+ filter: ['in', 'kind', 'college'],
431
+ paint: {
432
+ 'fill-color': 'hsl(60,0%,75%)',
433
+ 'fill-opacity': 0.1
434
+ }
435
+ },
436
+ {
437
+ id: 'site-school',
438
+ type: 'fill',
439
+ 'source-layer': 'sites',
440
+ filter: ['in', 'kind', 'school'],
441
+ paint: {
442
+ 'fill-color': 'hsl(60,0%,75%)',
443
+ 'fill-opacity': 0.1
444
+ }
445
+ },
446
+ {
447
+ id: 'site-hospital',
448
+ type: 'fill',
449
+ 'source-layer': 'sites',
450
+ filter: ['in', 'kind', 'hospital'],
451
+ paint: {
452
+ 'fill-color': 'hsl(0,0%,70%)',
453
+ 'fill-opacity': 0.1
454
+ }
455
+ },
456
+ {
457
+ id: 'site-prison',
458
+ type: 'fill',
459
+ 'source-layer': 'sites',
460
+ filter: ['in', 'kind', 'prison'],
461
+ paint: {
462
+ 'fill-color': 'hsl(305,0%,97%)',
463
+ 'fill-opacity': 0.1
464
+ }
465
+ },
466
+ {
467
+ id: 'site-parking',
468
+ type: 'fill',
469
+ 'source-layer': 'sites',
470
+ filter: ['in', 'kind', 'parking'],
471
+ paint: {
472
+ 'fill-color': 'hsl(24,0%,95%)'
473
+ }
474
+ },
475
+ {
476
+ id: 'site-bicycleparking',
477
+ type: 'fill',
478
+ 'source-layer': 'sites',
479
+ filter: ['in', 'kind', 'bicycle_parking'],
480
+ paint: {
481
+ 'fill-color': 'hsl(24,0%,95%)'
482
+ }
483
+ },
484
+ {
485
+ id: 'site-construction',
486
+ type: 'fill',
487
+ 'source-layer': 'sites',
488
+ filter: ['in', 'kind', 'construction'],
489
+ paint: {
490
+ 'fill-color': 'hsl(0,0%,66%)',
491
+ 'fill-opacity': 0.1
492
+ }
493
+ }
494
+ ].map((el) => {
495
+ return { source: 'versatiles-osm', ...el } as Layer;
496
+ });
497
+
498
+ return { landuse };
499
+ }
@@ -0,0 +1 @@
1
+ export default function makeNatural() {}
@@ -0,0 +1,199 @@
1
+ import tokens from '../tokens';
2
+ import type { SymbolLayerSpecification } from 'maplibre-gl';
3
+
4
+ export default function makePlaceLabels() {
5
+ const placeLabels: SymbolLayerSpecification[] = [
6
+ {
7
+ id: 'label-place-neighbourhood',
8
+ filter: ['==', 'kind', 'neighbourhood'],
9
+ minzoom: 14,
10
+ layout: {
11
+ 'text-field': '{name_de}',
12
+ 'text-font': tokens.sans_regular,
13
+ 'text-size': {
14
+ stops: [[14, 14]]
15
+ }
16
+ },
17
+ paint: {
18
+ 'text-color': tokens.label_secondary,
19
+ 'text-halo-color': tokens.background,
20
+ 'text-halo-width': 2
21
+ }
22
+ },
23
+ {
24
+ id: 'label-place-quarter',
25
+ filter: ['==', 'kind', 'quarter'],
26
+ minzoom: 14,
27
+ layout: {
28
+ 'text-field': '{name_de}',
29
+ 'text-font': tokens.sans_regular,
30
+ 'text-size': {
31
+ stops: [[10, 14]]
32
+ }
33
+ },
34
+ paint: {
35
+ 'text-color': tokens.label_secondary,
36
+ 'text-halo-color': tokens.background,
37
+ 'text-halo-width': 2
38
+ }
39
+ },
40
+ {
41
+ id: 'label-place-suburb',
42
+ filter: ['==', 'kind', 'suburb'],
43
+ minzoom: 11,
44
+ layout: {
45
+ 'text-field': '{name_de}',
46
+ 'text-font': tokens.sans_regular,
47
+ 'text-size': {
48
+ stops: [
49
+ [11, 13],
50
+ [13, 15]
51
+ ]
52
+ }
53
+ },
54
+ paint: {
55
+ 'text-color': tokens.label_secondary,
56
+ 'text-halo-color': tokens.background,
57
+ 'text-halo-width': 1.5
58
+ }
59
+ },
60
+ {
61
+ id: 'label-place-hamlet',
62
+ filter: ['==', 'kind', 'hamlet'],
63
+ minzoom: 13,
64
+ layout: {
65
+ 'text-field': '{name_de}',
66
+ 'text-font': tokens.sans_regular,
67
+ 'text-size': {
68
+ stops: [
69
+ [10, 11],
70
+ [12, 14]
71
+ ]
72
+ }
73
+ },
74
+ paint: {
75
+ 'text-color': tokens.label_secondary,
76
+ 'text-halo-color': tokens.background,
77
+ 'text-halo-width': 2
78
+ }
79
+ },
80
+ {
81
+ id: 'label-place-village',
82
+ filter: ['==', 'kind', 'village'],
83
+ minzoom: 11,
84
+ layout: {
85
+ 'text-field': '{name_de}',
86
+ 'text-font': tokens.sans_regular,
87
+ 'text-size': {
88
+ stops: [
89
+ [9, 11],
90
+ [12, 14]
91
+ ]
92
+ }
93
+ },
94
+ paint: {
95
+ 'text-color': tokens.label_secondary,
96
+ 'text-halo-color': tokens.background,
97
+ 'text-halo-width': 2
98
+ }
99
+ },
100
+
101
+ {
102
+ id: 'label-place-town',
103
+ filter: ['==', 'kind', 'town'],
104
+ minzoom: 9,
105
+ layout: {
106
+ 'text-field': '{name_de}',
107
+ 'text-font': tokens.sans_regular,
108
+ 'text-letter-spacing': 0.015,
109
+ 'text-size': {
110
+ stops: [
111
+ [8, 13],
112
+ [12, 16]
113
+ ]
114
+ }
115
+ },
116
+ paint: {
117
+ 'text-color': tokens.label_primary,
118
+ 'text-halo-color': tokens.background,
119
+ 'text-halo-width': 2
120
+ }
121
+ },
122
+
123
+ {
124
+ id: 'label-place-city',
125
+ filter: ['==', 'kind', 'city'],
126
+ minzoom: 6,
127
+ maxzoom: 11,
128
+ layout: {
129
+ 'text-field': '{name_de}',
130
+ 'text-font': tokens.sans_regular,
131
+ 'text-letter-spacing': 0.015,
132
+ 'text-size': {
133
+ stops: [
134
+ [8, 14],
135
+ [10, 14]
136
+ ]
137
+ }
138
+ },
139
+ paint: {
140
+ 'text-color': tokens.label_secondary,
141
+ 'text-halo-color': tokens.background,
142
+ 'text-halo-width': 2
143
+ }
144
+ },
145
+ {
146
+ id: 'label-place-statecapital',
147
+ filter: ['==', 'kind', 'state_capital'],
148
+ minzoom: 5,
149
+ maxzoom: 12,
150
+ layout: {
151
+ 'text-field': '{name_de}',
152
+ 'text-font': tokens.sans_regular,
153
+ 'text-letter-spacing': 0.025,
154
+ 'text-size': {
155
+ stops: [
156
+ [5, 13],
157
+ [14, 20]
158
+ ]
159
+ }
160
+ },
161
+ paint: {
162
+ 'text-color': tokens.label_secondary,
163
+ 'text-halo-color': tokens.background,
164
+ 'text-halo-width': 1
165
+ }
166
+ },
167
+ {
168
+ id: 'label-place-capital',
169
+ filter: ['all', ['==', 'kind', 'capital'], ['==', 'name_de', 'Berlin']],
170
+ minzoom: 5,
171
+ maxzoom: 12,
172
+ layout: {
173
+ 'text-field': '{name_de}',
174
+ 'text-letter-spacing': 0.015,
175
+ 'text-font': tokens.sans_medium,
176
+ 'text-size': {
177
+ stops: [
178
+ [5, 15],
179
+ [14, 20]
180
+ ]
181
+ }
182
+ },
183
+ paint: {
184
+ 'text-color': tokens.label_primary,
185
+ 'text-halo-color': tokens.background,
186
+ 'text-halo-width': 2
187
+ }
188
+ }
189
+ ].map((el) => {
190
+ return {
191
+ type: 'symbol',
192
+ source: 'versatiles-osm',
193
+ 'source-layer': 'place_labels',
194
+ ...el
195
+ } as SymbolLayerSpecification;
196
+ });
197
+
198
+ return { placeLabels };
199
+ }