@mapbox/mapbox-gl-style-spec 14.12.0 → 14.13.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/diff.ts +3 -1
- package/dist/index.cjs +321 -237
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -26
- package/dist/index.es.js +321 -237
- package/dist/index.es.js.map +1 -1
- package/expression/definitions/config.ts +30 -10
- package/expression/definitions/format.ts +2 -1
- package/expression/definitions/index.ts +8 -3
- package/expression/definitions/literal.ts +1 -1
- package/expression/definitions/match.ts +2 -2
- package/expression/index.ts +1 -0
- package/expression/is_constant.ts +4 -0
- package/expression/parsing_context.ts +1 -1
- package/expression/types/formatted.ts +1 -1
- package/expression/types.ts +8 -0
- package/expression/values.ts +1 -3
- package/group_by_layout.ts +1 -9
- package/package.json +1 -1
- package/reference/v8.json +102 -19
- package/types.ts +12 -4
- package/union-to-intersection.ts +1 -2
- package/util/color.ts +85 -69
- package/util/interpolate.ts +0 -4
- package/validate/validate_lights.ts +21 -21
package/dist/index.cjs
CHANGED
|
@@ -462,6 +462,7 @@
|
|
|
462
462
|
"zoom"
|
|
463
463
|
]
|
|
464
464
|
},
|
|
465
|
+
"use-theme": true,
|
|
465
466
|
transition: true,
|
|
466
467
|
doc: "Color of the directional light.",
|
|
467
468
|
"sdk-support": {
|
|
@@ -564,6 +565,7 @@
|
|
|
564
565
|
"zoom"
|
|
565
566
|
]
|
|
566
567
|
},
|
|
568
|
+
"use-theme": true,
|
|
567
569
|
transition: true,
|
|
568
570
|
doc: "Color of the ambient light.",
|
|
569
571
|
"sdk-support": {
|
|
@@ -668,6 +670,7 @@
|
|
|
668
670
|
"zoom"
|
|
669
671
|
]
|
|
670
672
|
},
|
|
673
|
+
"use-theme": true,
|
|
671
674
|
transition: true,
|
|
672
675
|
doc: "Color tint for lighting extruded geometries.",
|
|
673
676
|
"sdk-support": {
|
|
@@ -802,6 +805,7 @@
|
|
|
802
805
|
length: 4,
|
|
803
806
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
804
807
|
},
|
|
808
|
+
experimental: true,
|
|
805
809
|
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
806
810
|
},
|
|
807
811
|
scheme: {
|
|
@@ -891,6 +895,7 @@
|
|
|
891
895
|
length: 4,
|
|
892
896
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
893
897
|
},
|
|
898
|
+
experimental: true,
|
|
894
899
|
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
895
900
|
},
|
|
896
901
|
minzoom: {
|
|
@@ -982,6 +987,7 @@
|
|
|
982
987
|
length: 4,
|
|
983
988
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
984
989
|
},
|
|
990
|
+
experimental: true,
|
|
985
991
|
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
986
992
|
},
|
|
987
993
|
minzoom: {
|
|
@@ -1074,6 +1080,7 @@
|
|
|
1074
1080
|
length: 4,
|
|
1075
1081
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
1076
1082
|
},
|
|
1083
|
+
experimental: true,
|
|
1077
1084
|
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
1078
1085
|
},
|
|
1079
1086
|
minzoom: {
|
|
@@ -1785,11 +1792,13 @@
|
|
|
1785
1792
|
"sdk-support": {
|
|
1786
1793
|
"basic functionality": {
|
|
1787
1794
|
android: "11.11.0",
|
|
1788
|
-
ios: "11.11.0"
|
|
1795
|
+
ios: "11.11.0",
|
|
1796
|
+
js: "3.14.0"
|
|
1789
1797
|
},
|
|
1790
1798
|
"data-driven styling": {
|
|
1791
1799
|
android: "11.11.0",
|
|
1792
|
-
ios: "11.11.0"
|
|
1800
|
+
ios: "11.11.0",
|
|
1801
|
+
js: "3.14.0"
|
|
1793
1802
|
}
|
|
1794
1803
|
},
|
|
1795
1804
|
expression: {
|
|
@@ -1844,7 +1853,8 @@
|
|
|
1844
1853
|
"sdk-support": {
|
|
1845
1854
|
"basic functionality": {
|
|
1846
1855
|
android: "11.11.0",
|
|
1847
|
-
ios: "11.11.0"
|
|
1856
|
+
ios: "11.11.0",
|
|
1857
|
+
js: "3.14.0"
|
|
1848
1858
|
}
|
|
1849
1859
|
},
|
|
1850
1860
|
expression: {
|
|
@@ -4583,6 +4593,18 @@
|
|
|
4583
4593
|
}
|
|
4584
4594
|
}
|
|
4585
4595
|
},
|
|
4596
|
+
worldview: {
|
|
4597
|
+
doc: "Returns the current worldview being used.",
|
|
4598
|
+
group: "Lookup",
|
|
4599
|
+
experimental: true,
|
|
4600
|
+
"sdk-support": {
|
|
4601
|
+
"basic functionality": {
|
|
4602
|
+
js: "3.13.0",
|
|
4603
|
+
android: "11.13.0",
|
|
4604
|
+
ios: "11.13.0"
|
|
4605
|
+
}
|
|
4606
|
+
}
|
|
4607
|
+
},
|
|
4586
4608
|
id: {
|
|
4587
4609
|
doc: "Returns the feature's id, if it has one.",
|
|
4588
4610
|
group: "Feature data",
|
|
@@ -5211,6 +5233,7 @@
|
|
|
5211
5233
|
],
|
|
5212
5234
|
relaxZoomRestriction: true
|
|
5213
5235
|
},
|
|
5236
|
+
"use-theme": true,
|
|
5214
5237
|
transition: true,
|
|
5215
5238
|
doc: "The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.",
|
|
5216
5239
|
"sdk-support": {
|
|
@@ -5233,6 +5256,7 @@
|
|
|
5233
5256
|
],
|
|
5234
5257
|
relaxZoomRestriction: true
|
|
5235
5258
|
},
|
|
5259
|
+
"use-theme": true,
|
|
5236
5260
|
transition: true,
|
|
5237
5261
|
doc: "The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.",
|
|
5238
5262
|
"sdk-support": {
|
|
@@ -5267,6 +5291,7 @@
|
|
|
5267
5291
|
],
|
|
5268
5292
|
relaxZoomRestriction: true
|
|
5269
5293
|
},
|
|
5294
|
+
"use-theme": true,
|
|
5270
5295
|
transition: true,
|
|
5271
5296
|
doc: "The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.",
|
|
5272
5297
|
"sdk-support": {
|
|
@@ -5454,6 +5479,7 @@
|
|
|
5454
5479
|
],
|
|
5455
5480
|
relaxZoomRestriction: true
|
|
5456
5481
|
},
|
|
5482
|
+
"use-theme": true,
|
|
5457
5483
|
transition: true,
|
|
5458
5484
|
doc: "Snow particles color.",
|
|
5459
5485
|
"sdk-support": {
|
|
@@ -5539,6 +5565,7 @@
|
|
|
5539
5565
|
],
|
|
5540
5566
|
relaxZoomRestriction: true
|
|
5541
5567
|
},
|
|
5568
|
+
"use-theme": true,
|
|
5542
5569
|
transition: true,
|
|
5543
5570
|
doc: "Snow vignette screen-space corners tint color.",
|
|
5544
5571
|
"sdk-support": {
|
|
@@ -5723,6 +5750,7 @@
|
|
|
5723
5750
|
],
|
|
5724
5751
|
relaxZoomRestriction: true
|
|
5725
5752
|
},
|
|
5753
|
+
"use-theme": true,
|
|
5726
5754
|
transition: true,
|
|
5727
5755
|
doc: "Individual rain particle dorplets color.",
|
|
5728
5756
|
"sdk-support": {
|
|
@@ -5834,6 +5862,7 @@
|
|
|
5834
5862
|
],
|
|
5835
5863
|
relaxZoomRestriction: true
|
|
5836
5864
|
},
|
|
5865
|
+
"use-theme": true,
|
|
5837
5866
|
transition: true,
|
|
5838
5867
|
doc: "Rain vignette screen-space corners tint color.",
|
|
5839
5868
|
"sdk-support": {
|
|
@@ -6097,6 +6126,7 @@
|
|
|
6097
6126
|
"zoom"
|
|
6098
6127
|
]
|
|
6099
6128
|
},
|
|
6129
|
+
"use-theme": true,
|
|
6100
6130
|
transition: true,
|
|
6101
6131
|
doc: "Color tint for lighting extruded geometries.",
|
|
6102
6132
|
"sdk-support": {
|
|
@@ -6345,6 +6375,7 @@
|
|
|
6345
6375
|
type: "color",
|
|
6346
6376
|
"default": "#000000",
|
|
6347
6377
|
doc: "The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",
|
|
6378
|
+
"use-theme": true,
|
|
6348
6379
|
transition: true,
|
|
6349
6380
|
requires: [
|
|
6350
6381
|
{
|
|
@@ -6377,6 +6408,7 @@
|
|
|
6377
6408
|
"fill-outline-color": {
|
|
6378
6409
|
type: "color",
|
|
6379
6410
|
doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
|
|
6411
|
+
"use-theme": true,
|
|
6380
6412
|
transition: true,
|
|
6381
6413
|
requires: [
|
|
6382
6414
|
{
|
|
@@ -6508,11 +6540,12 @@
|
|
|
6508
6540
|
],
|
|
6509
6541
|
"sdk-support": {
|
|
6510
6542
|
"basic functionality": {
|
|
6511
|
-
js: "3.12.0"
|
|
6543
|
+
js: "3.12.0",
|
|
6544
|
+
android: "11.14.0",
|
|
6545
|
+
ios: "11.14.0"
|
|
6512
6546
|
}
|
|
6513
6547
|
},
|
|
6514
|
-
doc: "Controls the transition progress between the image variants of fill-pattern. Zero means the first variant is used, one is the second, and in between they are blended together."
|
|
6515
|
-
transition: true
|
|
6548
|
+
doc: "Controls the transition progress between the image variants of fill-pattern. Zero means the first variant is used, one is the second, and in between they are blended together. Both images should be the same size and have the same type (either raster or vector)."
|
|
6516
6549
|
},
|
|
6517
6550
|
"fill-emissive-strength": {
|
|
6518
6551
|
type: "number",
|
|
@@ -6570,15 +6603,18 @@
|
|
|
6570
6603
|
doc: "The color of bridge guard rail.",
|
|
6571
6604
|
experimental: true,
|
|
6572
6605
|
"private": true,
|
|
6606
|
+
"use-theme": true,
|
|
6573
6607
|
transition: true,
|
|
6574
6608
|
"sdk-support": {
|
|
6575
6609
|
"basic functionality": {
|
|
6576
6610
|
android: "11.11.0",
|
|
6577
|
-
ios: "11.11.0"
|
|
6611
|
+
ios: "11.11.0",
|
|
6612
|
+
js: "3.14.0"
|
|
6578
6613
|
},
|
|
6579
6614
|
"data-driven styling": {
|
|
6580
6615
|
android: "11.11.0",
|
|
6581
|
-
ios: "11.11.0"
|
|
6616
|
+
ios: "11.11.0",
|
|
6617
|
+
js: "3.14.0"
|
|
6582
6618
|
}
|
|
6583
6619
|
},
|
|
6584
6620
|
expression: {
|
|
@@ -6595,17 +6631,20 @@
|
|
|
6595
6631
|
type: "color",
|
|
6596
6632
|
"default": "rgba(241, 236, 225, 255)",
|
|
6597
6633
|
doc: "The color of tunnel structures (tunnel entrance and tunnel walls).",
|
|
6634
|
+
"use-theme": true,
|
|
6598
6635
|
transition: true,
|
|
6599
6636
|
experimental: true,
|
|
6600
6637
|
"private": true,
|
|
6601
6638
|
"sdk-support": {
|
|
6602
6639
|
"basic functionality": {
|
|
6603
6640
|
android: "11.11.0",
|
|
6604
|
-
ios: "11.11.0"
|
|
6641
|
+
ios: "11.11.0",
|
|
6642
|
+
js: "3.14.0"
|
|
6605
6643
|
},
|
|
6606
6644
|
"data-driven styling": {
|
|
6607
6645
|
android: "11.11.0",
|
|
6608
|
-
ios: "11.11.0"
|
|
6646
|
+
ios: "11.11.0",
|
|
6647
|
+
js: "3.14.0"
|
|
6609
6648
|
}
|
|
6610
6649
|
},
|
|
6611
6650
|
expression: {
|
|
@@ -6763,6 +6802,8 @@
|
|
|
6763
6802
|
doc: "Color buildings. This can be styled using different building parts (e.g. windows, wall, roof, etc.). This won't be used if `building-roof-shape` has a value `flat`.",
|
|
6764
6803
|
experimental: true,
|
|
6765
6804
|
"private": true,
|
|
6805
|
+
"use-theme": true,
|
|
6806
|
+
transition: false,
|
|
6766
6807
|
"sdk-support": {
|
|
6767
6808
|
"basic functionality": {
|
|
6768
6809
|
},
|
|
@@ -6837,6 +6878,7 @@
|
|
|
6837
6878
|
type: "color",
|
|
6838
6879
|
doc: "The color with which the line will be drawn.",
|
|
6839
6880
|
"default": "#000000",
|
|
6881
|
+
"use-theme": true,
|
|
6840
6882
|
transition: true,
|
|
6841
6883
|
requires: [
|
|
6842
6884
|
{
|
|
@@ -7116,11 +7158,12 @@
|
|
|
7116
7158
|
],
|
|
7117
7159
|
"sdk-support": {
|
|
7118
7160
|
"basic functionality": {
|
|
7119
|
-
js: "3.12.0"
|
|
7161
|
+
js: "3.12.0",
|
|
7162
|
+
android: "11.14.0",
|
|
7163
|
+
ios: "11.14.0"
|
|
7120
7164
|
}
|
|
7121
7165
|
},
|
|
7122
|
-
doc: "Controls the transition progress between the image variants of line-pattern. Zero means the first variant is used, one is the second, and in between they are blended together."
|
|
7123
|
-
transition: true
|
|
7166
|
+
doc: "Controls the transition progress between the image variants of line-pattern. Zero means the first variant is used, one is the second, and in between they are blended together. Both images should be the same size and have the same type (either raster or vector)."
|
|
7124
7167
|
},
|
|
7125
7168
|
"line-gradient": {
|
|
7126
7169
|
type: "color",
|
|
@@ -7146,6 +7189,7 @@
|
|
|
7146
7189
|
1,
|
|
7147
7190
|
"red"
|
|
7148
7191
|
],
|
|
7192
|
+
"use-theme": true,
|
|
7149
7193
|
transition: false,
|
|
7150
7194
|
requires: [
|
|
7151
7195
|
{
|
|
@@ -7259,6 +7303,7 @@
|
|
|
7259
7303
|
doc: "The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.",
|
|
7260
7304
|
experimental: true,
|
|
7261
7305
|
"default": "transparent",
|
|
7306
|
+
"use-theme": true,
|
|
7262
7307
|
transition: true,
|
|
7263
7308
|
requires: [
|
|
7264
7309
|
"line-trim-offset",
|
|
@@ -7345,6 +7390,7 @@
|
|
|
7345
7390
|
"private": true,
|
|
7346
7391
|
doc: "The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",
|
|
7347
7392
|
"default": "rgba(0, 0, 0, 0)",
|
|
7393
|
+
"use-theme": true,
|
|
7348
7394
|
transition: true,
|
|
7349
7395
|
"sdk-support": {
|
|
7350
7396
|
"basic functionality": {
|
|
@@ -7426,6 +7472,7 @@
|
|
|
7426
7472
|
type: "color",
|
|
7427
7473
|
"default": "#000000",
|
|
7428
7474
|
doc: "The fill color of the circle.",
|
|
7475
|
+
"use-theme": true,
|
|
7429
7476
|
transition: true,
|
|
7430
7477
|
"sdk-support": {
|
|
7431
7478
|
"basic functionality": {
|
|
@@ -7652,6 +7699,7 @@
|
|
|
7652
7699
|
type: "color",
|
|
7653
7700
|
"default": "#000000",
|
|
7654
7701
|
doc: "The stroke color of the circle.",
|
|
7702
|
+
"use-theme": true,
|
|
7655
7703
|
transition: true,
|
|
7656
7704
|
"sdk-support": {
|
|
7657
7705
|
"basic functionality": {
|
|
@@ -7838,6 +7886,7 @@
|
|
|
7838
7886
|
"red"
|
|
7839
7887
|
],
|
|
7840
7888
|
doc: "Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\"heatmap-density\"]` as input.",
|
|
7889
|
+
"use-theme": true,
|
|
7841
7890
|
transition: false,
|
|
7842
7891
|
"sdk-support": {
|
|
7843
7892
|
"basic functionality": {
|
|
@@ -8013,6 +8062,7 @@
|
|
|
8013
8062
|
"icon-color": {
|
|
8014
8063
|
type: "color",
|
|
8015
8064
|
"default": "#000000",
|
|
8065
|
+
"use-theme": true,
|
|
8016
8066
|
transition: true,
|
|
8017
8067
|
doc: "The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",
|
|
8018
8068
|
requires: [
|
|
@@ -8044,6 +8094,7 @@
|
|
|
8044
8094
|
"icon-halo-color": {
|
|
8045
8095
|
type: "color",
|
|
8046
8096
|
"default": "rgba(0, 0, 0, 0)",
|
|
8097
|
+
"use-theme": true,
|
|
8047
8098
|
transition: true,
|
|
8048
8099
|
doc: "The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",
|
|
8049
8100
|
requires: [
|
|
@@ -8221,8 +8272,7 @@
|
|
|
8221
8272
|
ios: "11.0.0"
|
|
8222
8273
|
}
|
|
8223
8274
|
},
|
|
8224
|
-
doc: "Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together."
|
|
8225
|
-
transition: true
|
|
8275
|
+
doc: "Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together. . Both images should be the same size and have the same type (either raster or vector)."
|
|
8226
8276
|
},
|
|
8227
8277
|
"text-opacity": {
|
|
8228
8278
|
type: "number",
|
|
@@ -8294,6 +8344,7 @@
|
|
|
8294
8344
|
type: "color",
|
|
8295
8345
|
doc: "The color with which the text will be drawn.",
|
|
8296
8346
|
"default": "#000000",
|
|
8347
|
+
"use-theme": true,
|
|
8297
8348
|
transition: true,
|
|
8298
8349
|
overridable: true,
|
|
8299
8350
|
requires: [
|
|
@@ -8325,6 +8376,7 @@
|
|
|
8325
8376
|
"text-halo-color": {
|
|
8326
8377
|
type: "color",
|
|
8327
8378
|
"default": "rgba(0, 0, 0, 0)",
|
|
8379
|
+
"use-theme": true,
|
|
8328
8380
|
transition: true,
|
|
8329
8381
|
doc: "The color of the text's halo, which helps it stand out from backgrounds.",
|
|
8330
8382
|
requires: [
|
|
@@ -8610,6 +8662,7 @@
|
|
|
8610
8662
|
"raster-color": {
|
|
8611
8663
|
type: "color",
|
|
8612
8664
|
doc: "Defines a color map by which to colorize a raster layer, parameterized by the `[\"raster-value\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.",
|
|
8665
|
+
"use-theme": true,
|
|
8613
8666
|
transition: false,
|
|
8614
8667
|
"sdk-support": {
|
|
8615
8668
|
"basic functionality": {
|
|
@@ -8997,6 +9050,7 @@
|
|
|
8997
9050
|
type: "color",
|
|
8998
9051
|
"default": "#000000",
|
|
8999
9052
|
doc: "The shading color of areas that face away from the light source.",
|
|
9053
|
+
"use-theme": true,
|
|
9000
9054
|
transition: true,
|
|
9001
9055
|
"sdk-support": {
|
|
9002
9056
|
"basic functionality": {
|
|
@@ -9018,6 +9072,7 @@
|
|
|
9018
9072
|
type: "color",
|
|
9019
9073
|
"default": "#FFFFFF",
|
|
9020
9074
|
doc: "The shading color of areas that faces towards the light source.",
|
|
9075
|
+
"use-theme": true,
|
|
9021
9076
|
transition: true,
|
|
9022
9077
|
"sdk-support": {
|
|
9023
9078
|
"basic functionality": {
|
|
@@ -9039,6 +9094,7 @@
|
|
|
9039
9094
|
type: "color",
|
|
9040
9095
|
"default": "#000000",
|
|
9041
9096
|
doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
|
|
9097
|
+
"use-theme": true,
|
|
9042
9098
|
transition: true,
|
|
9043
9099
|
"sdk-support": {
|
|
9044
9100
|
"basic functionality": {
|
|
@@ -9115,6 +9171,7 @@
|
|
|
9115
9171
|
type: "color",
|
|
9116
9172
|
"default": "#000000",
|
|
9117
9173
|
doc: "The color with which the background will be drawn.",
|
|
9174
|
+
"use-theme": true,
|
|
9118
9175
|
transition: true,
|
|
9119
9176
|
requires: [
|
|
9120
9177
|
{
|
|
@@ -9370,6 +9427,7 @@
|
|
|
9370
9427
|
"white"
|
|
9371
9428
|
],
|
|
9372
9429
|
doc: "Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",
|
|
9430
|
+
"use-theme": true,
|
|
9373
9431
|
transition: false,
|
|
9374
9432
|
requires: [
|
|
9375
9433
|
{
|
|
@@ -9397,6 +9455,7 @@
|
|
|
9397
9455
|
type: "color",
|
|
9398
9456
|
"default": "white",
|
|
9399
9457
|
doc: "A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",
|
|
9458
|
+
"use-theme": true,
|
|
9400
9459
|
transition: false,
|
|
9401
9460
|
requires: [
|
|
9402
9461
|
{
|
|
@@ -9416,6 +9475,7 @@
|
|
|
9416
9475
|
type: "color",
|
|
9417
9476
|
"default": "white",
|
|
9418
9477
|
doc: "A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",
|
|
9478
|
+
"use-theme": true,
|
|
9419
9479
|
transition: false,
|
|
9420
9480
|
requires: [
|
|
9421
9481
|
{
|
|
@@ -9611,6 +9671,7 @@
|
|
|
9611
9671
|
ios: "11.0.0"
|
|
9612
9672
|
}
|
|
9613
9673
|
},
|
|
9674
|
+
"use-theme": true,
|
|
9614
9675
|
transition: true
|
|
9615
9676
|
},
|
|
9616
9677
|
"model-color-mix-intensity": {
|
|
@@ -9883,6 +9944,25 @@
|
|
|
9883
9944
|
doc: "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state."
|
|
9884
9945
|
}
|
|
9885
9946
|
};
|
|
9947
|
+
var $doc = {
|
|
9948
|
+
transition: {
|
|
9949
|
+
type: "transition",
|
|
9950
|
+
doc: "Controls how a property transitions to a new value. Overrides the style's root `transition` for this property."
|
|
9951
|
+
},
|
|
9952
|
+
"use-theme": {
|
|
9953
|
+
type: "enum",
|
|
9954
|
+
doc: "Controls whether the associated color property is affected by the global color theme. When set to \"none\", the color theme is ignored for this property. When set to \"default\", the color theme is applied.",
|
|
9955
|
+
values: {
|
|
9956
|
+
"default": {
|
|
9957
|
+
doc: "The color theme is applied to this property (default behavior)."
|
|
9958
|
+
},
|
|
9959
|
+
none: {
|
|
9960
|
+
doc: "The color theme is ignored for this property."
|
|
9961
|
+
}
|
|
9962
|
+
},
|
|
9963
|
+
"default": "default"
|
|
9964
|
+
}
|
|
9965
|
+
};
|
|
9886
9966
|
var v8 = {
|
|
9887
9967
|
$version: $version,
|
|
9888
9968
|
$root: $root,
|
|
@@ -10229,6 +10309,7 @@
|
|
|
10229
10309
|
type: "color",
|
|
10230
10310
|
"default": "#000000",
|
|
10231
10311
|
doc: "The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",
|
|
10312
|
+
"use-theme": true,
|
|
10232
10313
|
transition: true,
|
|
10233
10314
|
requires: [
|
|
10234
10315
|
{
|
|
@@ -10357,11 +10438,12 @@
|
|
|
10357
10438
|
],
|
|
10358
10439
|
"sdk-support": {
|
|
10359
10440
|
"basic functionality": {
|
|
10360
|
-
js: "3.12.0"
|
|
10441
|
+
js: "3.12.0",
|
|
10442
|
+
android: "11.14.0",
|
|
10443
|
+
ios: "11.14.0"
|
|
10361
10444
|
}
|
|
10362
10445
|
},
|
|
10363
|
-
doc: "Controls the transition progress between the image variants of fill-extrusion-pattern. Zero means the first variant is used, one is the second, and in between they are blended together."
|
|
10364
|
-
transition: true
|
|
10446
|
+
doc: "Controls the transition progress between the image variants of fill-extrusion-pattern. Zero means the first variant is used, one is the second, and in between they are blended together. Both images should be the same size and have the same type (either raster or vector)."
|
|
10365
10447
|
},
|
|
10366
10448
|
"fill-extrusion-height": {
|
|
10367
10449
|
type: "number",
|
|
@@ -10626,6 +10708,7 @@
|
|
|
10626
10708
|
requires: [
|
|
10627
10709
|
"lights"
|
|
10628
10710
|
],
|
|
10711
|
+
"use-theme": true,
|
|
10629
10712
|
transition: true,
|
|
10630
10713
|
expression: {
|
|
10631
10714
|
interpolated: true,
|
|
@@ -10941,6 +11024,7 @@
|
|
|
10941
11024
|
"raster-particle-color": {
|
|
10942
11025
|
type: "color",
|
|
10943
11026
|
doc: "Defines a color map by which to colorize a raster particle layer, parameterized by the `[\"raster-particle-speed\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.",
|
|
11027
|
+
"use-theme": true,
|
|
10944
11028
|
transition: false,
|
|
10945
11029
|
"sdk-support": {
|
|
10946
11030
|
"basic functionality": {
|
|
@@ -11079,7 +11163,8 @@
|
|
|
11079
11163
|
doc: "Property is constant across all zoom levels and property values."
|
|
11080
11164
|
}
|
|
11081
11165
|
},
|
|
11082
|
-
promoteId: promoteId
|
|
11166
|
+
promoteId: promoteId,
|
|
11167
|
+
$doc: $doc
|
|
11083
11168
|
};
|
|
11084
11169
|
|
|
11085
11170
|
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
@@ -11502,6 +11587,13 @@
|
|
|
11502
11587
|
}
|
|
11503
11588
|
});
|
|
11504
11589
|
}
|
|
11590
|
+
function typeEquals(a, b) {
|
|
11591
|
+
if (a.kind === 'array' && b.kind === 'array') {
|
|
11592
|
+
return a.N === b.N && typeEquals(a.itemType, b.itemType);
|
|
11593
|
+
} else {
|
|
11594
|
+
return a.kind === b.kind;
|
|
11595
|
+
}
|
|
11596
|
+
}
|
|
11505
11597
|
|
|
11506
11598
|
function getDefaultExportFromCjs (x) {
|
|
11507
11599
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -12572,15 +12664,11 @@
|
|
|
12572
12664
|
return number(d, to[i], t);
|
|
12573
12665
|
});
|
|
12574
12666
|
}
|
|
12575
|
-
function easeIn(x) {
|
|
12576
|
-
return x * x * x * x * x;
|
|
12577
|
-
}
|
|
12578
12667
|
|
|
12579
12668
|
var interpolate$1 = /*#__PURE__*/Object.freeze({
|
|
12580
12669
|
__proto__: null,
|
|
12581
12670
|
array: array,
|
|
12582
12671
|
color: color,
|
|
12583
|
-
easeIn: easeIn,
|
|
12584
12672
|
number: number
|
|
12585
12673
|
});
|
|
12586
12674
|
|
|
@@ -12609,7 +12697,7 @@
|
|
|
12609
12697
|
if (!rgba) {
|
|
12610
12698
|
return void 0;
|
|
12611
12699
|
}
|
|
12612
|
-
return new Color(rgba[0] / 255
|
|
12700
|
+
return new Color(rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3]);
|
|
12613
12701
|
}
|
|
12614
12702
|
/**
|
|
12615
12703
|
* Returns an RGBA string representing the color value.
|
|
@@ -12621,20 +12709,6 @@
|
|
|
12621
12709
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
12622
12710
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
12623
12711
|
*/
|
|
12624
|
-
toStringPremultipliedAlpha() {
|
|
12625
|
-
const [r, g, b, a] = this.a === 0 ? [
|
|
12626
|
-
0,
|
|
12627
|
-
0,
|
|
12628
|
-
0,
|
|
12629
|
-
0
|
|
12630
|
-
] : [
|
|
12631
|
-
this.r * 255 / this.a,
|
|
12632
|
-
this.g * 255 / this.a,
|
|
12633
|
-
this.b * 255 / this.a,
|
|
12634
|
-
this.a
|
|
12635
|
-
];
|
|
12636
|
-
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
12637
|
-
}
|
|
12638
12712
|
toString() {
|
|
12639
12713
|
const [r, g, b, a] = [
|
|
12640
12714
|
this.r,
|
|
@@ -12644,16 +12718,22 @@
|
|
|
12644
12718
|
];
|
|
12645
12719
|
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
12646
12720
|
}
|
|
12647
|
-
|
|
12721
|
+
toNonPremultipliedRenderColor(lut) {
|
|
12648
12722
|
const {r, g, b, a} = this;
|
|
12649
|
-
return new
|
|
12723
|
+
return new NonPremultipliedRenderColor(lut, r, g, b, a);
|
|
12724
|
+
}
|
|
12725
|
+
toPremultipliedRenderColor(lut) {
|
|
12726
|
+
const {r, g, b, a} = this;
|
|
12727
|
+
return new PremultipliedRenderColor(lut, r * a, g * a, b * a, a);
|
|
12650
12728
|
}
|
|
12651
12729
|
clone() {
|
|
12652
12730
|
return new Color(this.r, this.g, this.b, this.a);
|
|
12653
12731
|
}
|
|
12654
12732
|
}
|
|
12655
12733
|
class RenderColor {
|
|
12656
|
-
constructor(lut, r, g, b, a) {
|
|
12734
|
+
constructor(lut, r, g, b, a, premultiplied = false) {
|
|
12735
|
+
this.premultiplied = false;
|
|
12736
|
+
this.premultiplied = premultiplied;
|
|
12657
12737
|
if (!lut) {
|
|
12658
12738
|
this.r = r;
|
|
12659
12739
|
this.g = g;
|
|
@@ -12662,9 +12742,15 @@
|
|
|
12662
12742
|
} else {
|
|
12663
12743
|
const N = lut.image.height;
|
|
12664
12744
|
const N2 = N * N;
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12745
|
+
if (this.premultiplied) {
|
|
12746
|
+
r = a === 0 ? 0 : r / a * (N - 1);
|
|
12747
|
+
g = a === 0 ? 0 : g / a * (N - 1);
|
|
12748
|
+
b = a === 0 ? 0 : b / a * (N - 1);
|
|
12749
|
+
} else {
|
|
12750
|
+
r = r * (N - 1);
|
|
12751
|
+
g = g * (N - 1);
|
|
12752
|
+
b = b * (N - 1);
|
|
12753
|
+
}
|
|
12668
12754
|
const r0 = Math.floor(r);
|
|
12669
12755
|
const g0 = Math.floor(g);
|
|
12670
12756
|
const b0 = Math.floor(b);
|
|
@@ -12686,49 +12772,46 @@
|
|
|
12686
12772
|
if (i0 < 0 || i7 >= data.length) {
|
|
12687
12773
|
throw new Error('out of range');
|
|
12688
12774
|
}
|
|
12689
|
-
this.r = number(number(number(data[i0], data[i1], bw), number(data[i2], data[i3], bw), gw), number(number(data[i4], data[i5], bw), number(data[i6], data[i7], bw), gw), rw) / 255 * a;
|
|
12690
|
-
this.g = number(number(number(data[i0 + 1], data[i1 + 1], bw), number(data[i2 + 1], data[i3 + 1], bw), gw), number(number(data[i4 + 1], data[i5 + 1], bw), number(data[i6 + 1], data[i7 + 1], bw), gw), rw) / 255 * a;
|
|
12691
|
-
this.b = number(number(number(data[i0 + 2], data[i1 + 2], bw), number(data[i2 + 2], data[i3 + 2], bw), gw), number(number(data[i4 + 2], data[i5 + 2], bw), number(data[i6 + 2], data[i7 + 2], bw), gw), rw) / 255 * a;
|
|
12775
|
+
this.r = number(number(number(data[i0], data[i1], bw), number(data[i2], data[i3], bw), gw), number(number(data[i4], data[i5], bw), number(data[i6], data[i7], bw), gw), rw) / 255 * (this.premultiplied ? a : 1);
|
|
12776
|
+
this.g = number(number(number(data[i0 + 1], data[i1 + 1], bw), number(data[i2 + 1], data[i3 + 1], bw), gw), number(number(data[i4 + 1], data[i5 + 1], bw), number(data[i6 + 1], data[i7 + 1], bw), gw), rw) / 255 * (this.premultiplied ? a : 1);
|
|
12777
|
+
this.b = number(number(number(data[i0 + 2], data[i1 + 2], bw), number(data[i2 + 2], data[i3 + 2], bw), gw), number(number(data[i4 + 2], data[i5 + 2], bw), number(data[i6 + 2], data[i7 + 2], bw), gw), rw) / 255 * (this.premultiplied ? a : 1);
|
|
12692
12778
|
this.a = a;
|
|
12693
12779
|
}
|
|
12694
12780
|
}
|
|
12695
12781
|
/**
|
|
12696
|
-
* Returns an RGBA array of values representing the color
|
|
12697
|
-
*
|
|
12782
|
+
* Returns an RGBA array of values representing the color.
|
|
12698
12783
|
* @returns An array of RGBA color values in the range [0, 255].
|
|
12699
12784
|
*/
|
|
12700
12785
|
toArray() {
|
|
12701
12786
|
const {r, g, b, a} = this;
|
|
12702
|
-
return
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
|
|
12706
|
-
0
|
|
12707
|
-
] : [
|
|
12708
|
-
r * 255 / a,
|
|
12709
|
-
g * 255 / a,
|
|
12710
|
-
b * 255 / a,
|
|
12787
|
+
return [
|
|
12788
|
+
r * 255,
|
|
12789
|
+
g * 255,
|
|
12790
|
+
b * 255,
|
|
12711
12791
|
a
|
|
12712
12792
|
];
|
|
12713
12793
|
}
|
|
12714
12794
|
/**
|
|
12715
12795
|
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
12716
|
-
*
|
|
12717
12796
|
* @returns An array of HSLA color values.
|
|
12718
12797
|
*/
|
|
12719
12798
|
toHslaArray() {
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12799
|
+
let {r, g, b, a} = this;
|
|
12800
|
+
if (this.premultiplied) {
|
|
12801
|
+
if (a === 0)
|
|
12802
|
+
return [
|
|
12803
|
+
0,
|
|
12804
|
+
0,
|
|
12805
|
+
0,
|
|
12806
|
+
0
|
|
12807
|
+
];
|
|
12808
|
+
r /= a;
|
|
12809
|
+
g /= a;
|
|
12810
|
+
b /= a;
|
|
12727
12811
|
}
|
|
12728
|
-
const
|
|
12729
|
-
const
|
|
12730
|
-
const
|
|
12731
|
-
const blue = Math.min(Math.max(b / a, 0), 1);
|
|
12812
|
+
const red = Math.min(Math.max(r, 0), 1);
|
|
12813
|
+
const green = Math.min(Math.max(g, 0), 1);
|
|
12814
|
+
const blue = Math.min(Math.max(b, 0), 1);
|
|
12732
12815
|
const min = Math.min(red, green, blue);
|
|
12733
12816
|
const max = Math.max(red, green, blue);
|
|
12734
12817
|
const l = (min + max) / 2;
|
|
@@ -12759,21 +12842,16 @@
|
|
|
12759
12842
|
];
|
|
12760
12843
|
}
|
|
12761
12844
|
/**
|
|
12762
|
-
* Returns a RGBA array of float values representing the color
|
|
12845
|
+
* Returns a RGBA array of float values representing the color.
|
|
12763
12846
|
*
|
|
12764
12847
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12765
12848
|
*/
|
|
12766
12849
|
toArray01() {
|
|
12767
12850
|
const {r, g, b, a} = this;
|
|
12768
|
-
return
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
0
|
|
12773
|
-
] : [
|
|
12774
|
-
r / a,
|
|
12775
|
-
g / a,
|
|
12776
|
-
b / a,
|
|
12851
|
+
return [
|
|
12852
|
+
r,
|
|
12853
|
+
g,
|
|
12854
|
+
b,
|
|
12777
12855
|
a
|
|
12778
12856
|
];
|
|
12779
12857
|
}
|
|
@@ -12784,52 +12862,39 @@
|
|
|
12784
12862
|
* @returns An array of RGB color values in the range [0, 1].
|
|
12785
12863
|
*/
|
|
12786
12864
|
toArray01Scaled(scale) {
|
|
12787
|
-
const {r, g, b
|
|
12788
|
-
return a === 0 ? [
|
|
12789
|
-
0,
|
|
12790
|
-
0,
|
|
12791
|
-
0
|
|
12792
|
-
] : [
|
|
12793
|
-
r / a * scale,
|
|
12794
|
-
g / a * scale,
|
|
12795
|
-
b / a * scale
|
|
12796
|
-
];
|
|
12797
|
-
}
|
|
12798
|
-
/**
|
|
12799
|
-
* Returns an RGBA array of values representing the color, premultiplied by A.
|
|
12800
|
-
*
|
|
12801
|
-
* @returns An array of RGBA color values in the range [0, 1].
|
|
12802
|
-
*/
|
|
12803
|
-
toArray01PremultipliedAlpha() {
|
|
12804
|
-
const {r, g, b, a} = this;
|
|
12865
|
+
const {r, g, b} = this;
|
|
12805
12866
|
return [
|
|
12806
|
-
r,
|
|
12807
|
-
g,
|
|
12808
|
-
b
|
|
12809
|
-
a
|
|
12867
|
+
r * scale,
|
|
12868
|
+
g * scale,
|
|
12869
|
+
b * scale
|
|
12810
12870
|
];
|
|
12811
12871
|
}
|
|
12812
12872
|
/**
|
|
12813
|
-
* Returns an RGBA array of values representing the color
|
|
12814
|
-
* The color is defined by sRGB primaries, but the sRGB transfer function
|
|
12815
|
-
*
|
|
12873
|
+
* Returns an RGBA array of values representing the color converted to linear color space.
|
|
12874
|
+
* The color is defined by sRGB primaries, but the sRGB transfer function
|
|
12875
|
+
* is reversed to obtain linear energy.
|
|
12816
12876
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12817
12877
|
*/
|
|
12818
12878
|
toArray01Linear() {
|
|
12819
12879
|
const {r, g, b, a} = this;
|
|
12820
|
-
return
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
0
|
|
12825
|
-
] : [
|
|
12826
|
-
Math.pow(r / a, 2.2),
|
|
12827
|
-
Math.pow(g / a, 2.2),
|
|
12828
|
-
Math.pow(b / a, 2.2),
|
|
12880
|
+
return [
|
|
12881
|
+
Math.pow(r, 2.2),
|
|
12882
|
+
Math.pow(g, 2.2),
|
|
12883
|
+
Math.pow(b, 2.2),
|
|
12829
12884
|
a
|
|
12830
12885
|
];
|
|
12831
12886
|
}
|
|
12832
12887
|
}
|
|
12888
|
+
class NonPremultipliedRenderColor extends RenderColor {
|
|
12889
|
+
constructor(lut, r, g, b, a) {
|
|
12890
|
+
super(lut, r, g, b, a, false);
|
|
12891
|
+
}
|
|
12892
|
+
}
|
|
12893
|
+
class PremultipliedRenderColor extends RenderColor {
|
|
12894
|
+
constructor(lut, r, g, b, a) {
|
|
12895
|
+
super(lut, r, g, b, a, true);
|
|
12896
|
+
}
|
|
12897
|
+
}
|
|
12833
12898
|
Color.black = new Color(0, 0, 0, 1);
|
|
12834
12899
|
Color.white = new Color(1, 1, 1, 1);
|
|
12835
12900
|
Color.transparent = new Color(0, 0, 0, 0);
|
|
@@ -12918,7 +12983,7 @@
|
|
|
12918
12983
|
options['font-scale'] = section.scale;
|
|
12919
12984
|
}
|
|
12920
12985
|
if (section.textColor) {
|
|
12921
|
-
options['text-color'] = ['rgba'].concat(section.textColor.
|
|
12986
|
+
options['text-color'] = ['rgba'].concat(section.textColor.toNonPremultipliedRenderColor(null).toArray());
|
|
12922
12987
|
}
|
|
12923
12988
|
serialized.push(options);
|
|
12924
12989
|
}
|
|
@@ -13216,9 +13281,7 @@
|
|
|
13216
13281
|
return '';
|
|
13217
13282
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
13218
13283
|
return String(value);
|
|
13219
|
-
} else if (value instanceof Color) {
|
|
13220
|
-
return value.toStringPremultipliedAlpha();
|
|
13221
|
-
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
13284
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage || value instanceof Color) {
|
|
13222
13285
|
return value.toString();
|
|
13223
13286
|
} else {
|
|
13224
13287
|
return JSON.stringify(value);
|
|
@@ -13258,7 +13321,7 @@
|
|
|
13258
13321
|
this.value
|
|
13259
13322
|
];
|
|
13260
13323
|
} else if (this.value instanceof Color) {
|
|
13261
|
-
return ['rgba'].concat(this.value.
|
|
13324
|
+
return ['rgba'].concat(this.value.toNonPremultipliedRenderColor(null).toArray());
|
|
13262
13325
|
} else if (this.value instanceof Formatted) {
|
|
13263
13326
|
return this.value.serialize();
|
|
13264
13327
|
} else {
|
|
@@ -13424,7 +13487,7 @@
|
|
|
13424
13487
|
evaluate(ctx) {
|
|
13425
13488
|
const evaluateSection = section => {
|
|
13426
13489
|
const evaluatedContent = section.content.evaluate(ctx);
|
|
13427
|
-
if (typeOf(evaluatedContent)
|
|
13490
|
+
if (typeEquals(typeOf(evaluatedContent), ResolvedImageType)) {
|
|
13428
13491
|
return new FormattedSection('', evaluatedContent, null, null, null);
|
|
13429
13492
|
}
|
|
13430
13493
|
return new FormattedSection(toString(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(',') : null, section.textColor ? section.textColor.evaluate(ctx) : null);
|
|
@@ -13931,7 +13994,7 @@
|
|
|
13931
13994
|
continue;
|
|
13932
13995
|
overloadParams.push(params);
|
|
13933
13996
|
overloadIndex++;
|
|
13934
|
-
signatureContext = new ParsingContext
|
|
13997
|
+
signatureContext = new ParsingContext(context.registry, context.path, null, context.scope, void 0, context._scope, context.options);
|
|
13935
13998
|
const parsedArgs = [];
|
|
13936
13999
|
let argParseFailed = false;
|
|
13937
14000
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15825,6 +15888,89 @@
|
|
|
15825
15888
|
}
|
|
15826
15889
|
}
|
|
15827
15890
|
|
|
15891
|
+
function isFeatureConstant(e) {
|
|
15892
|
+
if (e instanceof CompoundExpression) {
|
|
15893
|
+
if (e.name === 'get' && e.args.length === 1) {
|
|
15894
|
+
return false;
|
|
15895
|
+
} else if (e.name === 'feature-state') {
|
|
15896
|
+
return false;
|
|
15897
|
+
} else if (e.name === 'has' && e.args.length === 1) {
|
|
15898
|
+
return false;
|
|
15899
|
+
} else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {
|
|
15900
|
+
return false;
|
|
15901
|
+
} else if (/^filter-/.test(e.name)) {
|
|
15902
|
+
return false;
|
|
15903
|
+
}
|
|
15904
|
+
}
|
|
15905
|
+
if (e instanceof Within) {
|
|
15906
|
+
return false;
|
|
15907
|
+
}
|
|
15908
|
+
if (e instanceof Distance) {
|
|
15909
|
+
return false;
|
|
15910
|
+
}
|
|
15911
|
+
if (e instanceof Config) {
|
|
15912
|
+
return e.featureConstant;
|
|
15913
|
+
}
|
|
15914
|
+
let result = true;
|
|
15915
|
+
e.eachChild(arg => {
|
|
15916
|
+
if (result && !isFeatureConstant(arg)) {
|
|
15917
|
+
result = false;
|
|
15918
|
+
}
|
|
15919
|
+
});
|
|
15920
|
+
return result;
|
|
15921
|
+
}
|
|
15922
|
+
function isStateConstant(e) {
|
|
15923
|
+
if (e instanceof CompoundExpression) {
|
|
15924
|
+
if (e.name === 'feature-state') {
|
|
15925
|
+
return false;
|
|
15926
|
+
}
|
|
15927
|
+
}
|
|
15928
|
+
let result = true;
|
|
15929
|
+
e.eachChild(arg => {
|
|
15930
|
+
if (result && !isStateConstant(arg)) {
|
|
15931
|
+
result = false;
|
|
15932
|
+
}
|
|
15933
|
+
});
|
|
15934
|
+
return result;
|
|
15935
|
+
}
|
|
15936
|
+
function getConfigDependencies(e) {
|
|
15937
|
+
if (e instanceof Config) {
|
|
15938
|
+
const singleConfig = /* @__PURE__ */
|
|
15939
|
+
new Set([e.key]);
|
|
15940
|
+
return singleConfig;
|
|
15941
|
+
}
|
|
15942
|
+
let result = /* @__PURE__ */
|
|
15943
|
+
new Set();
|
|
15944
|
+
e.eachChild(arg => {
|
|
15945
|
+
result = /* @__PURE__ */
|
|
15946
|
+
new Set([
|
|
15947
|
+
...result,
|
|
15948
|
+
...getConfigDependencies(arg)
|
|
15949
|
+
]);
|
|
15950
|
+
});
|
|
15951
|
+
return result;
|
|
15952
|
+
}
|
|
15953
|
+
function isGlobalPropertyConstant(e, properties) {
|
|
15954
|
+
if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
|
|
15955
|
+
return false;
|
|
15956
|
+
}
|
|
15957
|
+
let result = true;
|
|
15958
|
+
e.eachChild(arg => {
|
|
15959
|
+
if (result && !isGlobalPropertyConstant(arg, properties)) {
|
|
15960
|
+
result = false;
|
|
15961
|
+
}
|
|
15962
|
+
});
|
|
15963
|
+
return result;
|
|
15964
|
+
}
|
|
15965
|
+
|
|
15966
|
+
const FQIDSeparator = '\x1F';
|
|
15967
|
+
function makeConfigFQID(id, ownScope, contextScope) {
|
|
15968
|
+
return [
|
|
15969
|
+
id,
|
|
15970
|
+
ownScope,
|
|
15971
|
+
contextScope
|
|
15972
|
+
].filter(Boolean).join(FQIDSeparator);
|
|
15973
|
+
}
|
|
15828
15974
|
function coerceValue(type, value) {
|
|
15829
15975
|
switch (type) {
|
|
15830
15976
|
case 'string':
|
|
@@ -15857,10 +16003,11 @@
|
|
|
15857
16003
|
return value;
|
|
15858
16004
|
}
|
|
15859
16005
|
class Config {
|
|
15860
|
-
constructor(type, key, scope) {
|
|
16006
|
+
constructor(type, key, scope, featureConstant = false) {
|
|
15861
16007
|
this.type = type;
|
|
15862
16008
|
this.key = key;
|
|
15863
16009
|
this.scope = scope;
|
|
16010
|
+
this.featureConstant = featureConstant;
|
|
15864
16011
|
}
|
|
15865
16012
|
static parse(args, context) {
|
|
15866
16013
|
let type = context.expectedType;
|
|
@@ -15874,24 +16021,29 @@
|
|
|
15874
16021
|
if (!(configKey instanceof Literal)) {
|
|
15875
16022
|
return context.error(`Key name of 'config' expression must be a string literal.`);
|
|
15876
16023
|
}
|
|
16024
|
+
let featureConstant = true;
|
|
16025
|
+
let configScopeValue;
|
|
16026
|
+
const configKeyValue = toString(configKey.value);
|
|
15877
16027
|
if (args.length >= 3) {
|
|
15878
16028
|
const configScope = context.parse(args[2], 2);
|
|
15879
16029
|
if (!(configScope instanceof Literal)) {
|
|
15880
16030
|
return context.error(`Scope of 'config' expression must be a string literal.`);
|
|
15881
16031
|
}
|
|
15882
|
-
|
|
16032
|
+
configScopeValue = toString(configScope.value);
|
|
15883
16033
|
}
|
|
15884
|
-
|
|
16034
|
+
if (context.options) {
|
|
16035
|
+
const fqid = makeConfigFQID(configKeyValue, configScopeValue, context._scope);
|
|
16036
|
+
const config = context.options.get(fqid);
|
|
16037
|
+
if (config) {
|
|
16038
|
+
featureConstant = isFeatureConstant(config.value || config.default);
|
|
16039
|
+
}
|
|
16040
|
+
}
|
|
16041
|
+
return new Config(type, configKeyValue, configScopeValue, featureConstant);
|
|
15885
16042
|
}
|
|
15886
16043
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15887
16044
|
evaluate(ctx) {
|
|
15888
|
-
const
|
|
15889
|
-
const
|
|
15890
|
-
this.key,
|
|
15891
|
-
this.scope,
|
|
15892
|
-
ctx.scope
|
|
15893
|
-
].filter(Boolean).join(FQIDSeparator);
|
|
15894
|
-
const config = ctx.getConfig(configKey);
|
|
16045
|
+
const fqid = makeConfigFQID(this.key, this.scope, ctx.scope);
|
|
16046
|
+
const config = ctx.getConfig(fqid);
|
|
15895
16047
|
if (!config)
|
|
15896
16048
|
return null;
|
|
15897
16049
|
const {type, value, values, minValue, maxValue, stepValue} = config;
|
|
@@ -15919,7 +16071,7 @@
|
|
|
15919
16071
|
result = coerceValue(type, result);
|
|
15920
16072
|
}
|
|
15921
16073
|
}
|
|
15922
|
-
if (type && type !== this.type || result !== void 0 && typeOf(result)
|
|
16074
|
+
if (type && type !== this.type || result !== void 0 && !typeEquals(typeOf(result), this.type)) {
|
|
15923
16075
|
result = coerceValue(this.type.kind, result);
|
|
15924
16076
|
}
|
|
15925
16077
|
return result;
|
|
@@ -15935,84 +16087,12 @@
|
|
|
15935
16087
|
this.key
|
|
15936
16088
|
];
|
|
15937
16089
|
if (this.scope) {
|
|
15938
|
-
res.concat(this.
|
|
16090
|
+
res.concat(this.scope);
|
|
15939
16091
|
}
|
|
15940
16092
|
return res;
|
|
15941
16093
|
}
|
|
15942
16094
|
}
|
|
15943
16095
|
|
|
15944
|
-
function isFeatureConstant(e) {
|
|
15945
|
-
if (e instanceof CompoundExpression) {
|
|
15946
|
-
if (e.name === 'get' && e.args.length === 1) {
|
|
15947
|
-
return false;
|
|
15948
|
-
} else if (e.name === 'feature-state') {
|
|
15949
|
-
return false;
|
|
15950
|
-
} else if (e.name === 'has' && e.args.length === 1) {
|
|
15951
|
-
return false;
|
|
15952
|
-
} else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {
|
|
15953
|
-
return false;
|
|
15954
|
-
} else if (/^filter-/.test(e.name)) {
|
|
15955
|
-
return false;
|
|
15956
|
-
}
|
|
15957
|
-
}
|
|
15958
|
-
if (e instanceof Within) {
|
|
15959
|
-
return false;
|
|
15960
|
-
}
|
|
15961
|
-
if (e instanceof Distance) {
|
|
15962
|
-
return false;
|
|
15963
|
-
}
|
|
15964
|
-
let result = true;
|
|
15965
|
-
e.eachChild(arg => {
|
|
15966
|
-
if (result && !isFeatureConstant(arg)) {
|
|
15967
|
-
result = false;
|
|
15968
|
-
}
|
|
15969
|
-
});
|
|
15970
|
-
return result;
|
|
15971
|
-
}
|
|
15972
|
-
function isStateConstant(e) {
|
|
15973
|
-
if (e instanceof CompoundExpression) {
|
|
15974
|
-
if (e.name === 'feature-state') {
|
|
15975
|
-
return false;
|
|
15976
|
-
}
|
|
15977
|
-
}
|
|
15978
|
-
let result = true;
|
|
15979
|
-
e.eachChild(arg => {
|
|
15980
|
-
if (result && !isStateConstant(arg)) {
|
|
15981
|
-
result = false;
|
|
15982
|
-
}
|
|
15983
|
-
});
|
|
15984
|
-
return result;
|
|
15985
|
-
}
|
|
15986
|
-
function getConfigDependencies(e) {
|
|
15987
|
-
if (e instanceof Config) {
|
|
15988
|
-
const singleConfig = /* @__PURE__ */
|
|
15989
|
-
new Set([e.key]);
|
|
15990
|
-
return singleConfig;
|
|
15991
|
-
}
|
|
15992
|
-
let result = /* @__PURE__ */
|
|
15993
|
-
new Set();
|
|
15994
|
-
e.eachChild(arg => {
|
|
15995
|
-
result = /* @__PURE__ */
|
|
15996
|
-
new Set([
|
|
15997
|
-
...result,
|
|
15998
|
-
...getConfigDependencies(arg)
|
|
15999
|
-
]);
|
|
16000
|
-
});
|
|
16001
|
-
return result;
|
|
16002
|
-
}
|
|
16003
|
-
function isGlobalPropertyConstant(e, properties) {
|
|
16004
|
-
if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
|
|
16005
|
-
return false;
|
|
16006
|
-
}
|
|
16007
|
-
let result = true;
|
|
16008
|
-
e.eachChild(arg => {
|
|
16009
|
-
if (result && !isGlobalPropertyConstant(arg, properties)) {
|
|
16010
|
-
result = false;
|
|
16011
|
-
}
|
|
16012
|
-
});
|
|
16013
|
-
return result;
|
|
16014
|
-
}
|
|
16015
|
-
|
|
16016
16096
|
class Var {
|
|
16017
16097
|
constructor(name, boundExpression) {
|
|
16018
16098
|
this.type = boundExpression.type;
|
|
@@ -16180,7 +16260,6 @@
|
|
|
16180
16260
|
return error;
|
|
16181
16261
|
}
|
|
16182
16262
|
}
|
|
16183
|
-
var ParsingContext$1 = ParsingContext;
|
|
16184
16263
|
function isConstant(expression) {
|
|
16185
16264
|
if (expression instanceof Var) {
|
|
16186
16265
|
return isConstant(expression.boundExpression);
|
|
@@ -16210,6 +16289,7 @@
|
|
|
16210
16289
|
return isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [
|
|
16211
16290
|
'zoom',
|
|
16212
16291
|
'heatmap-density',
|
|
16292
|
+
'worldview',
|
|
16213
16293
|
'line-progress',
|
|
16214
16294
|
'raster-value',
|
|
16215
16295
|
'sky-radial-progress',
|
|
@@ -17103,7 +17183,7 @@
|
|
|
17103
17183
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17104
17184
|
evaluate(ctx) {
|
|
17105
17185
|
const input = this.input.evaluate(ctx);
|
|
17106
|
-
const output = typeOf(input)
|
|
17186
|
+
const output = typeEquals(typeOf(input), this.inputType) && this.outputs[this.cases[input]] || this.otherwise;
|
|
17107
17187
|
return output.evaluate(ctx);
|
|
17108
17188
|
}
|
|
17109
17189
|
eachChild(fn) {
|
|
@@ -17626,7 +17706,7 @@
|
|
|
17626
17706
|
const error = validateRGBA(r, g, b, alpha);
|
|
17627
17707
|
if (error)
|
|
17628
17708
|
throw new RuntimeError(error);
|
|
17629
|
-
return new Color(r / 255
|
|
17709
|
+
return new Color(r / 255, g / 255, b / 255, alpha);
|
|
17630
17710
|
}
|
|
17631
17711
|
function hsla(ctx, [h, s, l, a]) {
|
|
17632
17712
|
h = h.evaluate(ctx);
|
|
@@ -17693,14 +17773,14 @@
|
|
|
17693
17773
|
array$1(NumberType, 4),
|
|
17694
17774
|
[ColorType],
|
|
17695
17775
|
(ctx, [v]) => {
|
|
17696
|
-
return v.evaluate(ctx).
|
|
17776
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toArray();
|
|
17697
17777
|
}
|
|
17698
17778
|
],
|
|
17699
17779
|
'to-hsla': [
|
|
17700
17780
|
array$1(NumberType, 4),
|
|
17701
17781
|
[ColorType],
|
|
17702
17782
|
(ctx, [v]) => {
|
|
17703
|
-
return v.evaluate(ctx).
|
|
17783
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toHslaArray();
|
|
17704
17784
|
}
|
|
17705
17785
|
],
|
|
17706
17786
|
'rgb': [
|
|
@@ -17791,6 +17871,11 @@
|
|
|
17791
17871
|
[],
|
|
17792
17872
|
ctx => ctx.geometryType()
|
|
17793
17873
|
],
|
|
17874
|
+
'worldview': [
|
|
17875
|
+
StringType,
|
|
17876
|
+
[],
|
|
17877
|
+
ctx => ctx.globals.worldview || ''
|
|
17878
|
+
],
|
|
17794
17879
|
'id': [
|
|
17795
17880
|
ValueType,
|
|
17796
17881
|
[],
|
|
@@ -18551,7 +18636,7 @@
|
|
|
18551
18636
|
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === 'string' && expression[0] in expressions;
|
|
18552
18637
|
}
|
|
18553
18638
|
function createExpression(expression, propertySpec, scope, options) {
|
|
18554
|
-
const parser = new ParsingContext
|
|
18639
|
+
const parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0, void 0, void 0, scope, options);
|
|
18555
18640
|
const parsed = parser.parse(expression, void 0, void 0, void 0, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : void 0);
|
|
18556
18641
|
if (!parsed) {
|
|
18557
18642
|
return error(parser.errors);
|
|
@@ -20095,7 +20180,10 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
20095
20180
|
}
|
|
20096
20181
|
for (const afterImport of after) {
|
|
20097
20182
|
const beforeImport = beforeIndex[afterImport.id];
|
|
20098
|
-
if (!beforeImport
|
|
20183
|
+
if (!beforeImport)
|
|
20184
|
+
continue;
|
|
20185
|
+
delete beforeImport.data;
|
|
20186
|
+
if (deepEqual(beforeImport, afterImport))
|
|
20099
20187
|
continue;
|
|
20100
20188
|
commands.push({
|
|
20101
20189
|
command: operations.updateImport,
|
|
@@ -20580,7 +20668,6 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
20580
20668
|
errors2 = errors2.concat(validateStopDomainValue({
|
|
20581
20669
|
key: `${ key }[0]`,
|
|
20582
20670
|
value: value[0],
|
|
20583
|
-
valueSpec: {},
|
|
20584
20671
|
style: options2.style,
|
|
20585
20672
|
styleSpec: options2.styleSpec
|
|
20586
20673
|
}, value));
|
|
@@ -21175,10 +21262,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21175
21262
|
return validateEnum({
|
|
21176
21263
|
key: `${ key }.type`,
|
|
21177
21264
|
value: value.type,
|
|
21178
|
-
valueSpec: { values: getSourceTypeValues(styleSpec) }
|
|
21179
|
-
style,
|
|
21180
|
-
styleSpec
|
|
21181
|
-
});
|
|
21265
|
+
valueSpec: { values: getSourceTypeValues(styleSpec) }});
|
|
21182
21266
|
}
|
|
21183
21267
|
}
|
|
21184
21268
|
function getSourceTypeValues(styleSpec) {
|
|
@@ -21357,7 +21441,25 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21357
21441
|
return errors;
|
|
21358
21442
|
}
|
|
21359
21443
|
for (const propertyKey in properties) {
|
|
21360
|
-
|
|
21444
|
+
const transitionMatch = propertyKey.match(/^(.*)-transition$/);
|
|
21445
|
+
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
21446
|
+
if (useThemeMatch && lightPropertySpec[useThemeMatch[1]]) {
|
|
21447
|
+
errors = errors.concat(validate({
|
|
21448
|
+
key: key2,
|
|
21449
|
+
value: properties[propertyKey],
|
|
21450
|
+
valueSpec: { type: 'string' },
|
|
21451
|
+
style,
|
|
21452
|
+
styleSpec
|
|
21453
|
+
}));
|
|
21454
|
+
} else if (transitionMatch && lightPropertySpec[transitionMatch[1]] && lightPropertySpec[transitionMatch[1]].transition) {
|
|
21455
|
+
errors = errors.concat(validate({
|
|
21456
|
+
key: key2,
|
|
21457
|
+
value: light[key2],
|
|
21458
|
+
valueSpec: styleSpec.transition,
|
|
21459
|
+
style,
|
|
21460
|
+
styleSpec
|
|
21461
|
+
}));
|
|
21462
|
+
} else if (!lightPropertySpec[propertyKey]) {
|
|
21361
21463
|
errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${ propertyKey }"`)]);
|
|
21362
21464
|
} else {
|
|
21363
21465
|
errors = errors.concat(validate({
|
|
@@ -21370,25 +21472,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21370
21472
|
}
|
|
21371
21473
|
}
|
|
21372
21474
|
} else {
|
|
21373
|
-
|
|
21374
|
-
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
21375
|
-
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
21376
|
-
errors = errors.concat(validate({
|
|
21377
|
-
key: key2,
|
|
21378
|
-
value: light[key2],
|
|
21379
|
-
valueSpec: { type: 'string' },
|
|
21380
|
-
style,
|
|
21381
|
-
styleSpec
|
|
21382
|
-
}));
|
|
21383
|
-
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
21384
|
-
errors = errors.concat(validate({
|
|
21385
|
-
key: key2,
|
|
21386
|
-
value: light[key2],
|
|
21387
|
-
valueSpec: styleSpec.transition,
|
|
21388
|
-
style,
|
|
21389
|
-
styleSpec
|
|
21390
|
-
}));
|
|
21391
|
-
} else if (lightSpec[key2]) {
|
|
21475
|
+
if (lightSpec[key2]) {
|
|
21392
21476
|
errors = errors.concat(validate({
|
|
21393
21477
|
key: key2,
|
|
21394
21478
|
value: light[key2],
|