@osm-editor-kit/osm-maplibre 0.1.0-alpha.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.
package/dist/index.js ADDED
@@ -0,0 +1,1368 @@
1
+ // src/meters-to-pixels.ts
2
+ var EARTH_CIRCUMFERENCE = 40075016686e-3;
3
+ var TILE_SIZE = 512;
4
+ var GERMANY_LAT = 51;
5
+ var PIXEL_SCALE_GERMANY = pixelScaleFactorAtLat(GERMANY_LAT);
6
+ var WIDTH_ZOOM_MIN = 0;
7
+ var WIDTH_ZOOM_MAX = 22;
8
+ function pixelScaleFactorAtLat(latitudeDeg) {
9
+ return EARTH_CIRCUMFERENCE * Math.cos(latitudeDeg * Math.PI / 180) / TILE_SIZE;
10
+ }
11
+ function metersPerPixel(zoom, latitudeDeg) {
12
+ return pixelScaleFactorAtLat(latitudeDeg) / 2 ** zoom;
13
+ }
14
+ function pixelsFromMeters(meters, zoom, latitudeDeg) {
15
+ return meters / metersPerPixel(zoom, latitudeDeg);
16
+ }
17
+ function scaleAtZoom(zoom, multiplier) {
18
+ return multiplier * 2 ** zoom / PIXEL_SCALE_GERMANY;
19
+ }
20
+ function lineWidthFromMeters(property = "roadWidthM", options) {
21
+ const extraMeters = options?.extraMeters ?? 0;
22
+ const widthExpr = extraMeters === 0 ? ["get", property] : ["+", ["get", property], extraMeters];
23
+ return [
24
+ "interpolate",
25
+ ["exponential", 2],
26
+ ["zoom"],
27
+ WIDTH_ZOOM_MIN,
28
+ ["*", widthExpr, scaleAtZoom(WIDTH_ZOOM_MIN, 1)],
29
+ WIDTH_ZOOM_MAX,
30
+ ["*", widthExpr, scaleAtZoom(WIDTH_ZOOM_MAX, 1)]
31
+ ];
32
+ }
33
+ function lineOffsetFromMeters(property = "roadWidthM", fraction = 0.5, options) {
34
+ const metersExpr = options?.sign === void 0 ? ["get", property] : ["*", ["get", property], options.sign];
35
+ return [
36
+ "interpolate",
37
+ ["exponential", 2],
38
+ ["zoom"],
39
+ WIDTH_ZOOM_MIN,
40
+ ["*", metersExpr, scaleAtZoom(WIDTH_ZOOM_MIN, fraction)],
41
+ WIDTH_ZOOM_MAX,
42
+ ["*", metersExpr, scaleAtZoom(WIDTH_ZOOM_MAX, fraction)]
43
+ ];
44
+ }
45
+
46
+ // src/map-focus-paint.ts
47
+ var MAP_FOCUS_MUTED_COLOR = "#94a3b8";
48
+ var MAP_FOCUS_MUTED_OPACITY = 0.3;
49
+ function focusCaseColor(matchExpression, activeColor, mutedColor = MAP_FOCUS_MUTED_COLOR) {
50
+ return ["case", matchExpression, activeColor, mutedColor];
51
+ }
52
+ function focusCaseOpacity(matchExpression, activeOpacity, mutedOpacity = MAP_FOCUS_MUTED_OPACITY) {
53
+ return ["case", matchExpression, activeOpacity, mutedOpacity];
54
+ }
55
+
56
+ // src/custom-content-anchor.ts
57
+ var MAP_CUSTOM_CONTENT_ANCHOR_SOURCE_ID = "map-custom-content-anchor";
58
+ var MAP_CUSTOM_CONTENT_ANCHOR_LAYER_ID = "map-custom-content-anchor";
59
+ function appendCustomContentAnchor(style) {
60
+ const hasAnchorLayer = style.layers.some(
61
+ (layer) => layer.id === MAP_CUSTOM_CONTENT_ANCHOR_LAYER_ID
62
+ );
63
+ if (hasAnchorLayer) return style;
64
+ return {
65
+ ...style,
66
+ sources: {
67
+ ...style.sources,
68
+ [MAP_CUSTOM_CONTENT_ANCHOR_SOURCE_ID]: {
69
+ type: "geojson",
70
+ data: { type: "FeatureCollection", features: [] }
71
+ }
72
+ },
73
+ layers: [
74
+ ...style.layers,
75
+ {
76
+ id: MAP_CUSTOM_CONTENT_ANCHOR_LAYER_ID,
77
+ type: "fill",
78
+ source: MAP_CUSTOM_CONTENT_ANCHOR_SOURCE_ID,
79
+ layout: { visibility: "none" },
80
+ paint: { "fill-opacity": 0 }
81
+ }
82
+ ]
83
+ };
84
+ }
85
+
86
+ // src/patch-openfreemap-style.ts
87
+ var NUMERIC_COMPARE = /* @__PURE__ */ new Set([">", "<", ">=", "<="]);
88
+ var SENTINEL_HIGH = 1e18;
89
+ var SENTINEL_LOW = -1e18;
90
+ function isGetProp(expr) {
91
+ return Array.isArray(expr) && expr[0] === "get" && typeof expr[1] === "string" && expr.length === 2;
92
+ }
93
+ function isCoalescedGet(expr) {
94
+ return Array.isArray(expr) && expr[0] === "coalesce" && expr.length >= 3 && isGetProp(expr[1]) && typeof expr[2] === "number";
95
+ }
96
+ function patchFilterExpression(expr) {
97
+ if (!Array.isArray(expr) || expr.length === 0) return expr;
98
+ const op = expr[0];
99
+ if (typeof op !== "string") return expr;
100
+ if (NUMERIC_COMPARE.has(op) && expr.length === 3) {
101
+ const left = expr[1];
102
+ const right = expr[2];
103
+ if (isGetProp(left) && typeof right === "number") {
104
+ const sentinel = op === "<=" || op === "<" ? SENTINEL_HIGH : SENTINEL_LOW;
105
+ return [op, ["coalesce", left, sentinel], right];
106
+ }
107
+ if (isCoalescedGet(left) && typeof right === "number") {
108
+ return expr;
109
+ }
110
+ if (typeof left === "number" && isGetProp(right)) {
111
+ const sentinel = op === "<=" || op === "<" ? SENTINEL_LOW : SENTINEL_HIGH;
112
+ return [op, left, ["coalesce", right, sentinel]];
113
+ }
114
+ if (typeof left === "number" && isCoalescedGet(right)) {
115
+ return expr;
116
+ }
117
+ }
118
+ return [op, ...expr.slice(1).map(patchFilterExpression)];
119
+ }
120
+ function patchLayerFilter(layer) {
121
+ if (!("filter" in layer) || layer.filter == null) return layer;
122
+ const next = patchFilterExpression(layer.filter);
123
+ if (JSON.stringify(next) === JSON.stringify(layer.filter)) return layer;
124
+ return { ...layer, filter: next };
125
+ }
126
+ function patchOpenFreeMapStyle(style) {
127
+ return {
128
+ ...style,
129
+ layers: style.layers.map(patchLayerFilter)
130
+ };
131
+ }
132
+
133
+ // src/styles/openfreemap-positron.json
134
+ var openfreemap_positron_default = {
135
+ version: 8,
136
+ sources: {
137
+ ne2_shaded: {
138
+ maxzoom: 6,
139
+ tileSize: 256,
140
+ tiles: ["https://tiles.openfreemap.org/natural_earth/ne2sr/{z}/{x}/{y}.png"],
141
+ type: "raster"
142
+ },
143
+ openmaptiles: {
144
+ type: "vector",
145
+ url: "https://tiles.openfreemap.org/planet"
146
+ },
147
+ "map-custom-content-anchor": {
148
+ type: "geojson",
149
+ data: {
150
+ type: "FeatureCollection",
151
+ features: []
152
+ }
153
+ }
154
+ },
155
+ sprite: "https://tiles.openfreemap.org/sprites/ofm_f384/ofm",
156
+ glyphs: "https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf",
157
+ layers: [
158
+ {
159
+ id: "background",
160
+ type: "background",
161
+ paint: {
162
+ "background-color": "rgb(242,243,240)"
163
+ }
164
+ },
165
+ {
166
+ id: "park",
167
+ type: "fill",
168
+ source: "openmaptiles",
169
+ "source-layer": "park",
170
+ filter: ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
171
+ paint: {
172
+ "fill-color": "rgb(230, 233, 229)"
173
+ }
174
+ },
175
+ {
176
+ id: "water",
177
+ type: "fill",
178
+ source: "openmaptiles",
179
+ "source-layer": "water",
180
+ filter: [
181
+ "all",
182
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
183
+ ["!=", ["get", "brunnel"], "tunnel"]
184
+ ],
185
+ paint: {
186
+ "fill-antialias": true,
187
+ "fill-color": "rgb(194, 200, 202)"
188
+ }
189
+ },
190
+ {
191
+ id: "landcover_ice_shelf",
192
+ type: "fill",
193
+ source: "openmaptiles",
194
+ "source-layer": "landcover",
195
+ maxzoom: 8,
196
+ filter: [
197
+ "all",
198
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
199
+ ["==", ["get", "subclass"], "ice_shelf"]
200
+ ],
201
+ paint: {
202
+ "fill-color": "hsl(0,0%,98%)",
203
+ "fill-opacity": 0.7
204
+ }
205
+ },
206
+ {
207
+ id: "landcover_glacier",
208
+ type: "fill",
209
+ source: "openmaptiles",
210
+ "source-layer": "landcover",
211
+ maxzoom: 8,
212
+ filter: [
213
+ "all",
214
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
215
+ ["==", ["get", "subclass"], "glacier"]
216
+ ],
217
+ paint: {
218
+ "fill-color": "hsl(0,0%,98%)",
219
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 8, 0.5]
220
+ }
221
+ },
222
+ {
223
+ id: "landuse_residential",
224
+ type: "fill",
225
+ source: "openmaptiles",
226
+ "source-layer": "landuse",
227
+ maxzoom: 16,
228
+ filter: [
229
+ "all",
230
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
231
+ ["==", ["get", "class"], "residential"]
232
+ ],
233
+ paint: {
234
+ "fill-color": "rgb(234, 234, 230)",
235
+ "fill-opacity": ["interpolate", ["exponential", 0.6], ["zoom"], 8, 0.8, 9, 0.6]
236
+ }
237
+ },
238
+ {
239
+ id: "landcover_wood",
240
+ type: "fill",
241
+ source: "openmaptiles",
242
+ "source-layer": "landcover",
243
+ minzoom: 10,
244
+ filter: [
245
+ "all",
246
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
247
+ ["==", ["get", "class"], "wood"]
248
+ ],
249
+ paint: {
250
+ "fill-color": "rgb(220,224,220)",
251
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 8, 0, 12, 1]
252
+ }
253
+ },
254
+ {
255
+ id: "waterway",
256
+ type: "line",
257
+ source: "openmaptiles",
258
+ "source-layer": "waterway",
259
+ filter: ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
260
+ paint: {
261
+ "line-color": "hsl(195,17%,78%)"
262
+ }
263
+ },
264
+ {
265
+ id: "building",
266
+ type: "fill",
267
+ source: "openmaptiles",
268
+ "source-layer": "building",
269
+ minzoom: 12,
270
+ paint: {
271
+ "fill-antialias": true,
272
+ "fill-color": "rgb(234, 234, 229)",
273
+ "fill-outline-color": "rgb(219, 219, 218)"
274
+ }
275
+ },
276
+ {
277
+ id: "tunnel_motorway_casing",
278
+ type: "line",
279
+ source: "openmaptiles",
280
+ "source-layer": "transportation",
281
+ minzoom: 6,
282
+ filter: [
283
+ "all",
284
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
285
+ ["all", ["==", ["get", "brunnel"], "tunnel"], ["==", ["get", "class"], "motorway"]]
286
+ ],
287
+ layout: {
288
+ "line-cap": "butt",
289
+ "line-join": "miter"
290
+ },
291
+ paint: {
292
+ "line-color": "rgb(213, 213, 213)",
293
+ "line-opacity": 1,
294
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 5.8, 0, 6, 3, 20, 40]
295
+ }
296
+ },
297
+ {
298
+ id: "tunnel_motorway_inner",
299
+ type: "line",
300
+ source: "openmaptiles",
301
+ "source-layer": "transportation",
302
+ minzoom: 6,
303
+ filter: [
304
+ "all",
305
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
306
+ ["all", ["==", ["get", "brunnel"], "tunnel"], ["==", ["get", "class"], "motorway"]]
307
+ ],
308
+ layout: {
309
+ "line-cap": "round",
310
+ "line-join": "round"
311
+ },
312
+ paint: {
313
+ "line-color": "rgb(234,234,234)",
314
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 4, 2, 6, 1.3, 20, 30]
315
+ }
316
+ },
317
+ {
318
+ id: "aeroway-taxiway",
319
+ type: "line",
320
+ source: "openmaptiles",
321
+ "source-layer": "aeroway",
322
+ minzoom: 12,
323
+ filter: ["match", ["get", "class"], ["taxiway"], true, false],
324
+ layout: {
325
+ "line-cap": "round",
326
+ "line-join": "round"
327
+ },
328
+ paint: {
329
+ "line-color": "hsl(0,0%,88%)",
330
+ "line-opacity": 1,
331
+ "line-width": ["interpolate", ["exponential", 1.55], ["zoom"], 13, 1.8, 20, 20]
332
+ }
333
+ },
334
+ {
335
+ id: "aeroway-runway-casing",
336
+ type: "line",
337
+ source: "openmaptiles",
338
+ "source-layer": "aeroway",
339
+ minzoom: 11,
340
+ filter: ["match", ["get", "class"], ["runway"], true, false],
341
+ layout: {
342
+ "line-cap": "round",
343
+ "line-join": "round"
344
+ },
345
+ paint: {
346
+ "line-color": "hsl(0,0%,88%)",
347
+ "line-opacity": 1,
348
+ "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 11, 6, 17, 55]
349
+ }
350
+ },
351
+ {
352
+ id: "aeroway-area",
353
+ type: "fill",
354
+ source: "openmaptiles",
355
+ "source-layer": "aeroway",
356
+ minzoom: 4,
357
+ filter: [
358
+ "all",
359
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
360
+ ["match", ["get", "class"], ["runway", "taxiway"], true, false]
361
+ ],
362
+ paint: {
363
+ "fill-color": "rgba(255, 255, 255, 1)",
364
+ "fill-opacity": ["interpolate", ["linear"], ["zoom"], 13, 0, 14, 1]
365
+ }
366
+ },
367
+ {
368
+ id: "aeroway-runway",
369
+ type: "line",
370
+ source: "openmaptiles",
371
+ "source-layer": "aeroway",
372
+ minzoom: 11,
373
+ filter: [
374
+ "all",
375
+ ["match", ["get", "class"], ["runway"], true, false],
376
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false]
377
+ ],
378
+ layout: {
379
+ "line-cap": "round",
380
+ "line-join": "round"
381
+ },
382
+ paint: {
383
+ "line-color": "rgba(255, 255, 255, 1)",
384
+ "line-opacity": 1,
385
+ "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 11, 4, 17, 50]
386
+ }
387
+ },
388
+ {
389
+ id: "road_area_pier",
390
+ type: "fill",
391
+ source: "openmaptiles",
392
+ "source-layer": "transportation",
393
+ filter: [
394
+ "all",
395
+ ["match", ["geometry-type"], ["MultiPolygon", "Polygon"], true, false],
396
+ ["==", ["get", "class"], "pier"]
397
+ ],
398
+ paint: {
399
+ "fill-antialias": true,
400
+ "fill-color": "rgb(242,243,240)"
401
+ }
402
+ },
403
+ {
404
+ id: "road_pier",
405
+ type: "line",
406
+ source: "openmaptiles",
407
+ "source-layer": "transportation",
408
+ filter: [
409
+ "all",
410
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
411
+ ["match", ["get", "class"], ["pier"], true, false]
412
+ ],
413
+ layout: {
414
+ "line-cap": "round",
415
+ "line-join": "round"
416
+ },
417
+ paint: {
418
+ "line-color": "rgb(242,243,240)",
419
+ "line-width": ["interpolate", ["exponential", 1.2], ["zoom"], 15, 1, 17, 4]
420
+ }
421
+ },
422
+ {
423
+ id: "highway_path",
424
+ type: "line",
425
+ source: "openmaptiles",
426
+ "source-layer": "transportation",
427
+ filter: [
428
+ "all",
429
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
430
+ ["==", ["get", "class"], "path"]
431
+ ],
432
+ layout: {
433
+ "line-cap": "round",
434
+ "line-join": "round"
435
+ },
436
+ paint: {
437
+ "line-color": "rgb(234, 234, 234)",
438
+ "line-opacity": 0.9,
439
+ "line-width": ["interpolate", ["exponential", 1.2], ["zoom"], 13, 1, 20, 10]
440
+ }
441
+ },
442
+ {
443
+ id: "highway_minor",
444
+ type: "line",
445
+ source: "openmaptiles",
446
+ "source-layer": "transportation",
447
+ minzoom: 8,
448
+ filter: [
449
+ "all",
450
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
451
+ ["match", ["get", "class"], ["minor", "service", "track"], true, false]
452
+ ],
453
+ layout: {
454
+ "line-cap": "round",
455
+ "line-join": "round"
456
+ },
457
+ paint: {
458
+ "line-color": "hsl(0,0%,88%)",
459
+ "line-opacity": 0.9,
460
+ "line-width": ["interpolate", ["exponential", 1.55], ["zoom"], 13, 1.8, 20, 20]
461
+ }
462
+ },
463
+ {
464
+ id: "highway_major_casing",
465
+ type: "line",
466
+ source: "openmaptiles",
467
+ "source-layer": "transportation",
468
+ minzoom: 11,
469
+ filter: [
470
+ "all",
471
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
472
+ ["match", ["get", "class"], ["primary", "secondary", "tertiary", "trunk"], true, false]
473
+ ],
474
+ layout: {
475
+ "line-cap": "butt",
476
+ "line-join": "miter"
477
+ },
478
+ paint: {
479
+ "line-color": "rgb(213, 213, 213)",
480
+ "line-dasharray": [12, 0],
481
+ "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 10, 3, 20, 23]
482
+ }
483
+ },
484
+ {
485
+ id: "highway_major_inner",
486
+ type: "line",
487
+ source: "openmaptiles",
488
+ "source-layer": "transportation",
489
+ minzoom: 11,
490
+ filter: [
491
+ "all",
492
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
493
+ ["match", ["get", "class"], ["primary", "secondary", "tertiary", "trunk"], true, false]
494
+ ],
495
+ layout: {
496
+ "line-cap": "round",
497
+ "line-join": "round"
498
+ },
499
+ paint: {
500
+ "line-color": "#fff",
501
+ "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 10, 2, 20, 20]
502
+ }
503
+ },
504
+ {
505
+ id: "highway_major_subtle",
506
+ type: "line",
507
+ source: "openmaptiles",
508
+ "source-layer": "transportation",
509
+ maxzoom: 11,
510
+ filter: [
511
+ "all",
512
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
513
+ ["match", ["get", "class"], ["primary", "secondary", "tertiary", "trunk"], true, false]
514
+ ],
515
+ layout: {
516
+ "line-cap": "round",
517
+ "line-join": "round"
518
+ },
519
+ paint: {
520
+ "line-color": "hsla(0,0%,85%,0.69)",
521
+ "line-width": 2
522
+ }
523
+ },
524
+ {
525
+ id: "highway_motorway_casing",
526
+ type: "line",
527
+ source: "openmaptiles",
528
+ "source-layer": "transportation",
529
+ minzoom: 6,
530
+ filter: [
531
+ "all",
532
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
533
+ [
534
+ "all",
535
+ ["match", ["get", "brunnel"], ["bridge", "tunnel"], false, true],
536
+ ["==", ["get", "class"], "motorway"]
537
+ ]
538
+ ],
539
+ layout: {
540
+ "line-cap": "butt",
541
+ "line-join": "miter"
542
+ },
543
+ paint: {
544
+ "line-color": "rgb(213, 213, 213)",
545
+ "line-dasharray": [2, 0],
546
+ "line-opacity": 1,
547
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 5.8, 0, 6, 3, 20, 40]
548
+ }
549
+ },
550
+ {
551
+ id: "highway_motorway_inner",
552
+ type: "line",
553
+ source: "openmaptiles",
554
+ "source-layer": "transportation",
555
+ minzoom: 6,
556
+ filter: [
557
+ "all",
558
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
559
+ [
560
+ "all",
561
+ ["match", ["get", "brunnel"], ["bridge", "tunnel"], false, true],
562
+ ["==", ["get", "class"], "motorway"]
563
+ ]
564
+ ],
565
+ layout: {
566
+ "line-cap": "round",
567
+ "line-join": "round"
568
+ },
569
+ paint: {
570
+ "line-color": ["interpolate", ["linear"], ["zoom"], 5.8, "hsla(0,0%,85%,0.53)", 6, "#fff"],
571
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 4, 2, 6, 1.3, 20, 30]
572
+ }
573
+ },
574
+ {
575
+ id: "highway_motorway_subtle",
576
+ type: "line",
577
+ source: "openmaptiles",
578
+ "source-layer": "transportation",
579
+ maxzoom: 6,
580
+ filter: [
581
+ "all",
582
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
583
+ ["==", ["get", "class"], "motorway"]
584
+ ],
585
+ layout: {
586
+ "line-cap": "round",
587
+ "line-join": "round"
588
+ },
589
+ paint: {
590
+ "line-color": "hsla(0,0%,85%,0.53)",
591
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 4, 2, 6, 1.3]
592
+ }
593
+ },
594
+ {
595
+ id: "railway_transit",
596
+ type: "line",
597
+ source: "openmaptiles",
598
+ "source-layer": "transportation",
599
+ minzoom: 16,
600
+ filter: [
601
+ "all",
602
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
603
+ [
604
+ "all",
605
+ ["==", ["get", "class"], "transit"],
606
+ ["match", ["get", "brunnel"], ["tunnel"], false, true]
607
+ ]
608
+ ],
609
+ layout: {
610
+ "line-join": "round"
611
+ },
612
+ paint: {
613
+ "line-color": "#dddddd",
614
+ "line-width": 3
615
+ }
616
+ },
617
+ {
618
+ id: "railway_transit_dashline",
619
+ type: "line",
620
+ source: "openmaptiles",
621
+ "source-layer": "transportation",
622
+ minzoom: 16,
623
+ filter: [
624
+ "all",
625
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
626
+ [
627
+ "all",
628
+ ["==", ["get", "class"], "transit"],
629
+ ["match", ["get", "brunnel"], ["tunnel"], false, true]
630
+ ]
631
+ ],
632
+ layout: {
633
+ "line-join": "round"
634
+ },
635
+ paint: {
636
+ "line-color": "#fafafa",
637
+ "line-dasharray": [3, 3],
638
+ "line-width": 2
639
+ }
640
+ },
641
+ {
642
+ id: "railway_service",
643
+ type: "line",
644
+ source: "openmaptiles",
645
+ "source-layer": "transportation",
646
+ minzoom: 16,
647
+ filter: [
648
+ "all",
649
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
650
+ ["all", ["==", ["get", "class"], "rail"], ["has", "service"]]
651
+ ],
652
+ layout: {
653
+ "line-join": "round"
654
+ },
655
+ paint: {
656
+ "line-color": "#dddddd",
657
+ "line-width": 3
658
+ }
659
+ },
660
+ {
661
+ id: "railway_service_dashline",
662
+ type: "line",
663
+ source: "openmaptiles",
664
+ "source-layer": "transportation",
665
+ minzoom: 16,
666
+ filter: [
667
+ "all",
668
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
669
+ ["==", ["get", "class"], "rail"],
670
+ ["has", "service"]
671
+ ],
672
+ layout: {
673
+ "line-join": "round"
674
+ },
675
+ paint: {
676
+ "line-color": "#fafafa",
677
+ "line-dasharray": [3, 3],
678
+ "line-width": 2
679
+ }
680
+ },
681
+ {
682
+ id: "railway",
683
+ type: "line",
684
+ source: "openmaptiles",
685
+ "source-layer": "transportation",
686
+ minzoom: 13,
687
+ filter: [
688
+ "all",
689
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
690
+ ["all", ["!", ["has", "service"]], ["==", ["get", "class"], "rail"]]
691
+ ],
692
+ layout: {
693
+ "line-join": "round"
694
+ },
695
+ paint: {
696
+ "line-color": "#dddddd",
697
+ "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 16, 3, 20, 7]
698
+ }
699
+ },
700
+ {
701
+ id: "railway_dashline",
702
+ type: "line",
703
+ source: "openmaptiles",
704
+ "source-layer": "transportation",
705
+ minzoom: 13,
706
+ filter: [
707
+ "all",
708
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
709
+ ["all", ["!", ["has", "service"]], ["==", ["get", "class"], "rail"]]
710
+ ],
711
+ layout: {
712
+ "line-join": "round"
713
+ },
714
+ paint: {
715
+ "line-color": "#fafafa",
716
+ "line-dasharray": [3, 3],
717
+ "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 16, 2, 20, 6]
718
+ }
719
+ },
720
+ {
721
+ id: "highway_motorway_bridge_casing",
722
+ type: "line",
723
+ source: "openmaptiles",
724
+ "source-layer": "transportation",
725
+ minzoom: 6,
726
+ filter: [
727
+ "all",
728
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
729
+ ["all", ["==", ["get", "brunnel"], "bridge"], ["==", ["get", "class"], "motorway"]]
730
+ ],
731
+ layout: {
732
+ "line-cap": "butt",
733
+ "line-join": "miter"
734
+ },
735
+ paint: {
736
+ "line-color": "rgb(213, 213, 213)",
737
+ "line-dasharray": [2, 0],
738
+ "line-opacity": 1,
739
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 5.8, 0, 6, 5, 20, 45]
740
+ }
741
+ },
742
+ {
743
+ id: "highway_motorway_bridge_inner",
744
+ type: "line",
745
+ source: "openmaptiles",
746
+ "source-layer": "transportation",
747
+ minzoom: 6,
748
+ filter: [
749
+ "all",
750
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
751
+ ["all", ["==", ["get", "brunnel"], "bridge"], ["==", ["get", "class"], "motorway"]]
752
+ ],
753
+ layout: {
754
+ "line-cap": "round",
755
+ "line-join": "round"
756
+ },
757
+ paint: {
758
+ "line-color": ["interpolate", ["linear"], ["zoom"], 5.8, "hsla(0,0%,85%,0.53)", 6, "#fff"],
759
+ "line-width": ["interpolate", ["exponential", 1.4], ["zoom"], 4, 2, 6, 1.3, 20, 30]
760
+ }
761
+ },
762
+ {
763
+ id: "boundary_3",
764
+ type: "line",
765
+ source: "openmaptiles",
766
+ "source-layer": "boundary",
767
+ minzoom: 8,
768
+ filter: [
769
+ "all",
770
+ [">=", ["coalesce", ["get", "admin_level"], -1e18], 3],
771
+ ["<=", ["coalesce", ["get", "admin_level"], 1e18], 6],
772
+ ["!=", ["get", "maritime"], 1],
773
+ ["!=", ["get", "disputed"], 1],
774
+ ["!", ["has", "claimed_by"]]
775
+ ],
776
+ paint: {
777
+ "line-color": "hsl(0,0%,70%)",
778
+ "line-dasharray": [1, 1],
779
+ "line-width": ["interpolate", ["linear", 1], ["zoom"], 7, 1, 11, 2]
780
+ }
781
+ },
782
+ {
783
+ id: "boundary_2",
784
+ type: "line",
785
+ source: "openmaptiles",
786
+ "source-layer": "boundary",
787
+ filter: [
788
+ "all",
789
+ ["==", ["get", "admin_level"], 2],
790
+ ["!=", ["get", "maritime"], 1],
791
+ ["!=", ["get", "disputed"], 1],
792
+ ["!", ["has", "claimed_by"]]
793
+ ],
794
+ layout: {
795
+ "line-cap": "round",
796
+ "line-join": "round"
797
+ },
798
+ paint: {
799
+ "line-color": "hsl(0,0%,70%)",
800
+ "line-opacity": ["interpolate", ["linear"], ["zoom"], 0, 0.4, 4, 1],
801
+ "line-width": ["interpolate", ["linear"], ["zoom"], 3, 1, 5, 1.2, 12, 3]
802
+ }
803
+ },
804
+ {
805
+ id: "boundary_disputed",
806
+ type: "line",
807
+ source: "openmaptiles",
808
+ "source-layer": "boundary",
809
+ filter: ["all", ["!=", ["get", "maritime"], 1], ["==", ["get", "disputed"], 1]],
810
+ paint: {
811
+ "line-color": "hsl(0,0%,70%)",
812
+ "line-dasharray": [1, 2],
813
+ "line-width": ["interpolate", ["linear"], ["zoom"], 3, 1, 5, 1.2, 12, 3]
814
+ }
815
+ },
816
+ {
817
+ id: "waterway_line_label",
818
+ type: "symbol",
819
+ source: "openmaptiles",
820
+ "source-layer": "waterway",
821
+ minzoom: 10,
822
+ filter: ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
823
+ layout: {
824
+ "symbol-placement": "line",
825
+ "symbol-spacing": 350,
826
+ "text-field": [
827
+ "case",
828
+ ["has", "name:nonlatin"],
829
+ ["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
830
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
831
+ ],
832
+ "text-font": ["Noto Sans Italic"],
833
+ "text-letter-spacing": 0.2,
834
+ "text-max-width": 5,
835
+ "text-size": 14
836
+ },
837
+ paint: {
838
+ "text-color": "hsl(0,0%,66%)",
839
+ "text-halo-color": "rgba(255,255,255,0.7)",
840
+ "text-halo-width": 1.5
841
+ }
842
+ },
843
+ {
844
+ id: "water_name_point_label",
845
+ type: "symbol",
846
+ source: "openmaptiles",
847
+ "source-layer": "water_name",
848
+ filter: ["match", ["geometry-type"], ["MultiPoint", "Point"], true, false],
849
+ layout: {
850
+ "text-field": [
851
+ "case",
852
+ ["has", "name:nonlatin"],
853
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
854
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
855
+ ],
856
+ "text-font": ["Noto Sans Italic"],
857
+ "text-letter-spacing": 0.2,
858
+ "text-max-width": 5,
859
+ "text-size": ["interpolate", ["linear"], ["zoom"], 0, 10, 8, 14]
860
+ },
861
+ paint: {
862
+ "text-color": "#495e91",
863
+ "text-halo-color": "rgba(255,255,255,0.7)",
864
+ "text-halo-width": 1.5
865
+ }
866
+ },
867
+ {
868
+ id: "water_name_line_label",
869
+ type: "symbol",
870
+ source: "openmaptiles",
871
+ "source-layer": "water_name",
872
+ filter: ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
873
+ layout: {
874
+ "symbol-placement": "line",
875
+ "symbol-spacing": 350,
876
+ "text-field": [
877
+ "case",
878
+ ["has", "name:nonlatin"],
879
+ ["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
880
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
881
+ ],
882
+ "text-font": ["Noto Sans Italic"],
883
+ "text-letter-spacing": 0.2,
884
+ "text-max-width": 5,
885
+ "text-size": 14
886
+ },
887
+ paint: {
888
+ "text-color": "#495e91",
889
+ "text-halo-color": "rgba(255,255,255,0.7)",
890
+ "text-halo-width": 1.5
891
+ }
892
+ },
893
+ {
894
+ id: "highway-name-path",
895
+ type: "symbol",
896
+ source: "openmaptiles",
897
+ "source-layer": "transportation_name",
898
+ minzoom: 15.5,
899
+ filter: ["==", ["get", "class"], "path"],
900
+ layout: {
901
+ "symbol-placement": "line",
902
+ "text-field": [
903
+ "case",
904
+ ["has", "name:nonlatin"],
905
+ ["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
906
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
907
+ ],
908
+ "text-font": ["Noto Sans Regular"],
909
+ "text-rotation-alignment": "map",
910
+ "text-size": ["interpolate", ["linear"], ["zoom"], 13, 12, 14, 13]
911
+ },
912
+ paint: {
913
+ "text-color": "hsl(30,0%,62%)",
914
+ "text-halo-color": "#f8f4f0",
915
+ "text-halo-width": 0.5
916
+ }
917
+ },
918
+ {
919
+ id: "highway-name-minor",
920
+ type: "symbol",
921
+ source: "openmaptiles",
922
+ "source-layer": "transportation_name",
923
+ minzoom: 15,
924
+ filter: [
925
+ "all",
926
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
927
+ ["match", ["get", "class"], ["minor", "service", "track"], true, false]
928
+ ],
929
+ layout: {
930
+ "symbol-placement": "line",
931
+ "text-field": [
932
+ "case",
933
+ ["has", "name:nonlatin"],
934
+ ["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
935
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
936
+ ],
937
+ "text-font": ["Noto Sans Regular"],
938
+ "text-rotation-alignment": "map",
939
+ "text-size": ["interpolate", ["linear"], ["zoom"], 13, 12, 14, 13]
940
+ },
941
+ paint: {
942
+ "text-color": "#666",
943
+ "text-halo-blur": 0.5,
944
+ "text-halo-width": 1
945
+ }
946
+ },
947
+ {
948
+ id: "highway-name-major",
949
+ type: "symbol",
950
+ source: "openmaptiles",
951
+ "source-layer": "transportation_name",
952
+ minzoom: 12.2,
953
+ filter: [
954
+ "match",
955
+ ["get", "class"],
956
+ ["primary", "secondary", "tertiary", "trunk"],
957
+ true,
958
+ false
959
+ ],
960
+ layout: {
961
+ "symbol-placement": "line",
962
+ "text-field": [
963
+ "case",
964
+ ["has", "name:nonlatin"],
965
+ ["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
966
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
967
+ ],
968
+ "text-font": ["Noto Sans Regular"],
969
+ "text-rotation-alignment": "map",
970
+ "text-size": ["interpolate", ["linear"], ["zoom"], 13, 12, 14, 13]
971
+ },
972
+ paint: {
973
+ "text-color": "#666",
974
+ "text-halo-blur": 0.5,
975
+ "text-halo-width": 1
976
+ }
977
+ },
978
+ {
979
+ id: "highway-shield-non-us",
980
+ type: "symbol",
981
+ source: "openmaptiles",
982
+ "source-layer": "transportation_name",
983
+ minzoom: 11,
984
+ filter: [
985
+ "all",
986
+ ["<=", ["coalesce", ["get", "ref_length"], 1e18], 6],
987
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
988
+ ["match", ["get", "network"], ["us-highway", "us-interstate", "us-state"], false, true]
989
+ ],
990
+ layout: {
991
+ "icon-image": ["concat", "road_", ["get", "ref_length"]],
992
+ "icon-rotation-alignment": "viewport",
993
+ "icon-size": 1,
994
+ "symbol-placement": ["step", ["zoom"], "point", 11, "line"],
995
+ "symbol-spacing": 200,
996
+ "text-field": ["to-string", ["get", "ref"]],
997
+ "text-font": ["Noto Sans Regular"],
998
+ "text-rotation-alignment": "viewport",
999
+ "text-size": 10
1000
+ }
1001
+ },
1002
+ {
1003
+ id: "highway-shield-us-interstate",
1004
+ type: "symbol",
1005
+ source: "openmaptiles",
1006
+ "source-layer": "transportation_name",
1007
+ minzoom: 11,
1008
+ filter: [
1009
+ "all",
1010
+ ["<=", ["coalesce", ["get", "ref_length"], 1e18], 6],
1011
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
1012
+ ["match", ["get", "network"], ["us-interstate"], true, false]
1013
+ ],
1014
+ layout: {
1015
+ "icon-image": ["concat", ["get", "network"], "_", ["get", "ref_length"]],
1016
+ "icon-rotation-alignment": "viewport",
1017
+ "icon-size": 1,
1018
+ "symbol-placement": ["step", ["zoom"], "point", 7, "line", 8, "line"],
1019
+ "symbol-spacing": 200,
1020
+ "text-field": ["to-string", ["get", "ref"]],
1021
+ "text-font": ["Noto Sans Regular"],
1022
+ "text-rotation-alignment": "viewport",
1023
+ "text-size": 10
1024
+ }
1025
+ },
1026
+ {
1027
+ id: "road_shield_us",
1028
+ type: "symbol",
1029
+ source: "openmaptiles",
1030
+ "source-layer": "transportation_name",
1031
+ minzoom: 12,
1032
+ filter: [
1033
+ "all",
1034
+ ["<=", ["coalesce", ["get", "ref_length"], 1e18], 6],
1035
+ ["match", ["geometry-type"], ["LineString", "MultiLineString"], true, false],
1036
+ ["match", ["get", "network"], ["us-highway", "us-state"], true, false]
1037
+ ],
1038
+ layout: {
1039
+ "icon-image": ["concat", ["get", "network"], "_", ["get", "ref_length"]],
1040
+ "icon-rotation-alignment": "viewport",
1041
+ "icon-size": 1,
1042
+ "symbol-placement": ["step", ["zoom"], "point", 11, "line"],
1043
+ "symbol-spacing": 200,
1044
+ "text-field": ["to-string", ["get", "ref"]],
1045
+ "text-font": ["Noto Sans Regular"],
1046
+ "text-rotation-alignment": "viewport",
1047
+ "text-size": 10
1048
+ }
1049
+ },
1050
+ {
1051
+ id: "airport",
1052
+ type: "symbol",
1053
+ source: "openmaptiles",
1054
+ "source-layer": "aerodrome_label",
1055
+ minzoom: 11,
1056
+ filter: ["all", ["has", "iata"]],
1057
+ layout: {
1058
+ "icon-image": "airport_11",
1059
+ "icon-size": 1,
1060
+ "text-anchor": "top",
1061
+ "text-field": [
1062
+ "case",
1063
+ ["has", "name:nonlatin"],
1064
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1065
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1066
+ ],
1067
+ "text-font": ["Noto Sans Regular"],
1068
+ "text-max-width": 9,
1069
+ "text-offset": [0, 0.6],
1070
+ "text-optional": true,
1071
+ "text-padding": 2,
1072
+ "text-size": 12
1073
+ },
1074
+ paint: {
1075
+ "text-color": "#666",
1076
+ "text-halo-blur": 0.5,
1077
+ "text-halo-color": "#ffffff",
1078
+ "text-halo-width": 1
1079
+ }
1080
+ },
1081
+ {
1082
+ id: "label_other",
1083
+ type: "symbol",
1084
+ source: "openmaptiles",
1085
+ "source-layer": "place",
1086
+ minzoom: 8,
1087
+ filter: [
1088
+ "match",
1089
+ ["get", "class"],
1090
+ ["city", "continent", "country", "state", "town", "village"],
1091
+ false,
1092
+ true
1093
+ ],
1094
+ layout: {
1095
+ "text-field": [
1096
+ "case",
1097
+ ["has", "name:nonlatin"],
1098
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1099
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1100
+ ],
1101
+ "text-font": ["Noto Sans Italic"],
1102
+ "text-letter-spacing": 0.1,
1103
+ "text-max-width": 9,
1104
+ "text-size": ["interpolate", ["linear"], ["zoom"], 8, 9, 12, 10],
1105
+ "text-transform": "uppercase"
1106
+ },
1107
+ paint: {
1108
+ "text-color": "#333",
1109
+ "text-halo-blur": 1,
1110
+ "text-halo-color": "#fff",
1111
+ "text-halo-width": 1
1112
+ }
1113
+ },
1114
+ {
1115
+ id: "label_village",
1116
+ type: "symbol",
1117
+ source: "openmaptiles",
1118
+ "source-layer": "place",
1119
+ minzoom: 9,
1120
+ filter: ["==", ["get", "class"], "village"],
1121
+ layout: {
1122
+ "icon-allow-overlap": true,
1123
+ "icon-image": ["step", ["zoom"], "circle_11_black", 10, ""],
1124
+ "icon-optional": false,
1125
+ "icon-size": 0.2,
1126
+ "text-anchor": "bottom",
1127
+ "text-field": [
1128
+ "case",
1129
+ ["has", "name:nonlatin"],
1130
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1131
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1132
+ ],
1133
+ "text-font": ["Noto Sans Regular"],
1134
+ "text-max-width": 8,
1135
+ "text-size": ["interpolate", ["exponential", 1.2], ["zoom"], 7, 10, 11, 12]
1136
+ },
1137
+ paint: {
1138
+ "text-color": "#000",
1139
+ "text-halo-blur": 1,
1140
+ "text-halo-color": "#fff",
1141
+ "text-halo-width": 1
1142
+ }
1143
+ },
1144
+ {
1145
+ id: "label_town",
1146
+ type: "symbol",
1147
+ source: "openmaptiles",
1148
+ "source-layer": "place",
1149
+ minzoom: 6,
1150
+ filter: ["==", ["get", "class"], "town"],
1151
+ layout: {
1152
+ "icon-allow-overlap": true,
1153
+ "icon-image": ["step", ["zoom"], "circle_11_black", 10, ""],
1154
+ "icon-optional": false,
1155
+ "icon-size": 0.2,
1156
+ "text-anchor": "bottom",
1157
+ "text-field": [
1158
+ "case",
1159
+ ["has", "name:nonlatin"],
1160
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1161
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1162
+ ],
1163
+ "text-font": ["Noto Sans Regular"],
1164
+ "text-max-width": 8,
1165
+ "text-size": ["interpolate", ["exponential", 1.2], ["zoom"], 7, 12, 11, 14]
1166
+ },
1167
+ paint: {
1168
+ "text-color": "#000",
1169
+ "text-halo-blur": 1,
1170
+ "text-halo-color": "#fff",
1171
+ "text-halo-width": 1
1172
+ }
1173
+ },
1174
+ {
1175
+ id: "label_state",
1176
+ type: "symbol",
1177
+ source: "openmaptiles",
1178
+ "source-layer": "place",
1179
+ minzoom: 5,
1180
+ maxzoom: 8,
1181
+ filter: ["==", ["get", "class"], "state"],
1182
+ layout: {
1183
+ "text-field": [
1184
+ "case",
1185
+ ["has", "name:nonlatin"],
1186
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1187
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1188
+ ],
1189
+ "text-font": ["Noto Sans Italic"],
1190
+ "text-letter-spacing": 0.2,
1191
+ "text-max-width": 9,
1192
+ "text-size": ["interpolate", ["linear"], ["zoom"], 5, 10, 8, 14],
1193
+ "text-transform": "uppercase"
1194
+ },
1195
+ paint: {
1196
+ "text-color": "#333",
1197
+ "text-halo-blur": 1,
1198
+ "text-halo-color": "#fff",
1199
+ "text-halo-width": 1
1200
+ }
1201
+ },
1202
+ {
1203
+ id: "label_city",
1204
+ type: "symbol",
1205
+ source: "openmaptiles",
1206
+ "source-layer": "place",
1207
+ minzoom: 3,
1208
+ filter: ["all", ["==", ["get", "class"], "city"], ["!=", ["get", "capital"], 2]],
1209
+ layout: {
1210
+ "icon-allow-overlap": true,
1211
+ "icon-image": ["step", ["zoom"], "circle_11_black", 9, ""],
1212
+ "icon-optional": false,
1213
+ "icon-size": 0.4,
1214
+ "text-anchor": "bottom",
1215
+ "text-field": [
1216
+ "case",
1217
+ ["has", "name:nonlatin"],
1218
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1219
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1220
+ ],
1221
+ "text-font": ["Noto Sans Regular"],
1222
+ "text-max-width": 8,
1223
+ "text-offset": [0, -0.1],
1224
+ "text-size": ["interpolate", ["exponential", 1.2], ["zoom"], 4, 11, 7, 13, 11, 18]
1225
+ },
1226
+ paint: {
1227
+ "text-color": "#000",
1228
+ "text-halo-blur": 1,
1229
+ "text-halo-color": "#fff",
1230
+ "text-halo-width": 1
1231
+ }
1232
+ },
1233
+ {
1234
+ id: "label_city_capital",
1235
+ type: "symbol",
1236
+ source: "openmaptiles",
1237
+ "source-layer": "place",
1238
+ minzoom: 3,
1239
+ filter: ["all", ["==", ["get", "class"], "city"], ["==", ["get", "capital"], 2]],
1240
+ layout: {
1241
+ "icon-allow-overlap": true,
1242
+ "icon-image": ["step", ["zoom"], "circle_11_black", 9, ""],
1243
+ "icon-optional": false,
1244
+ "icon-size": 0.5,
1245
+ "text-anchor": "bottom",
1246
+ "text-field": [
1247
+ "case",
1248
+ ["has", "name:nonlatin"],
1249
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1250
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1251
+ ],
1252
+ "text-font": ["Noto Sans Bold"],
1253
+ "text-max-width": 8,
1254
+ "text-offset": [0, -0.2],
1255
+ "text-size": ["interpolate", ["exponential", 1.2], ["zoom"], 4, 12, 7, 14, 11, 20]
1256
+ },
1257
+ paint: {
1258
+ "text-color": "#000",
1259
+ "text-halo-blur": 1,
1260
+ "text-halo-color": "#fff",
1261
+ "text-halo-width": 1
1262
+ }
1263
+ },
1264
+ {
1265
+ id: "label_country_3",
1266
+ type: "symbol",
1267
+ source: "openmaptiles",
1268
+ "source-layer": "place",
1269
+ minzoom: 2,
1270
+ maxzoom: 9,
1271
+ filter: [
1272
+ "all",
1273
+ ["==", ["get", "class"], "country"],
1274
+ [">=", ["coalesce", ["get", "rank"], -1e18], 3]
1275
+ ],
1276
+ layout: {
1277
+ "text-field": [
1278
+ "case",
1279
+ ["has", "name:nonlatin"],
1280
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1281
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1282
+ ],
1283
+ "text-font": ["Noto Sans Bold"],
1284
+ "text-max-width": 6.25,
1285
+ "text-size": ["interpolate", ["linear"], ["zoom"], 3, 9, 7, 17]
1286
+ },
1287
+ paint: {
1288
+ "text-color": "#000",
1289
+ "text-halo-blur": 1,
1290
+ "text-halo-color": "#fff",
1291
+ "text-halo-width": 1
1292
+ }
1293
+ },
1294
+ {
1295
+ id: "label_country_2",
1296
+ type: "symbol",
1297
+ source: "openmaptiles",
1298
+ "source-layer": "place",
1299
+ maxzoom: 9,
1300
+ filter: ["all", ["==", ["get", "class"], "country"], ["==", ["get", "rank"], 2]],
1301
+ layout: {
1302
+ "text-field": [
1303
+ "case",
1304
+ ["has", "name:nonlatin"],
1305
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1306
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1307
+ ],
1308
+ "text-font": ["Noto Sans Bold"],
1309
+ "text-max-width": 6.25,
1310
+ "text-size": ["interpolate", ["linear"], ["zoom"], 2, 9, 5, 17]
1311
+ },
1312
+ paint: {
1313
+ "text-color": "#000",
1314
+ "text-halo-blur": 1,
1315
+ "text-halo-color": "#fff",
1316
+ "text-halo-width": 1
1317
+ }
1318
+ },
1319
+ {
1320
+ id: "label_country_1",
1321
+ type: "symbol",
1322
+ source: "openmaptiles",
1323
+ "source-layer": "place",
1324
+ maxzoom: 9,
1325
+ filter: ["all", ["==", ["get", "class"], "country"], ["==", ["get", "rank"], 1]],
1326
+ layout: {
1327
+ "text-field": [
1328
+ "case",
1329
+ ["has", "name:nonlatin"],
1330
+ ["concat", ["get", "name:latin"], "\n", ["get", "name:nonlatin"]],
1331
+ ["coalesce", ["get", "name_en"], ["get", "name"]]
1332
+ ],
1333
+ "text-font": ["Noto Sans Bold"],
1334
+ "text-max-width": 6.25,
1335
+ "text-size": ["interpolate", ["linear"], ["zoom"], 1, 9, 4, 17]
1336
+ },
1337
+ paint: {
1338
+ "text-color": "#000",
1339
+ "text-halo-blur": 1,
1340
+ "text-halo-color": "#fff",
1341
+ "text-halo-width": 1
1342
+ }
1343
+ },
1344
+ {
1345
+ id: "map-custom-content-anchor",
1346
+ type: "fill",
1347
+ source: "map-custom-content-anchor",
1348
+ layout: {
1349
+ visibility: "none"
1350
+ },
1351
+ paint: {
1352
+ "fill-opacity": 0
1353
+ }
1354
+ }
1355
+ ]
1356
+ };
1357
+
1358
+ // src/openfreemap-style.ts
1359
+ var OPENFREEMAP_POSITRON_STYLE_URL = "https://tiles.openfreemap.org/styles/positron";
1360
+ var OPENFREEMAP_POSITRON_IMAGERY_USED = "OpenFreeMap Positron";
1361
+ function buildOpenFreeMapPositronStyle(style) {
1362
+ return appendCustomContentAnchor(patchOpenFreeMapStyle(style));
1363
+ }
1364
+ var OPENFREEMAP_POSITRON_STYLE = buildOpenFreeMapPositronStyle(
1365
+ openfreemap_positron_default
1366
+ );
1367
+
1368
+ export { EARTH_CIRCUMFERENCE, GERMANY_LAT, MAP_CUSTOM_CONTENT_ANCHOR_LAYER_ID, MAP_CUSTOM_CONTENT_ANCHOR_SOURCE_ID, MAP_FOCUS_MUTED_COLOR, MAP_FOCUS_MUTED_OPACITY, OPENFREEMAP_POSITRON_IMAGERY_USED, OPENFREEMAP_POSITRON_STYLE, OPENFREEMAP_POSITRON_STYLE_URL, PIXEL_SCALE_GERMANY, TILE_SIZE, appendCustomContentAnchor, buildOpenFreeMapPositronStyle, focusCaseColor, focusCaseOpacity, lineOffsetFromMeters, lineWidthFromMeters, metersPerPixel, patchOpenFreeMapStyle, pixelScaleFactorAtLat, pixelsFromMeters };