@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.es.js
CHANGED
|
@@ -456,6 +456,7 @@ var properties_light_directional = {
|
|
|
456
456
|
"zoom"
|
|
457
457
|
]
|
|
458
458
|
},
|
|
459
|
+
"use-theme": true,
|
|
459
460
|
transition: true,
|
|
460
461
|
doc: "Color of the directional light.",
|
|
461
462
|
"sdk-support": {
|
|
@@ -558,6 +559,7 @@ var properties_light_ambient = {
|
|
|
558
559
|
"zoom"
|
|
559
560
|
]
|
|
560
561
|
},
|
|
562
|
+
"use-theme": true,
|
|
561
563
|
transition: true,
|
|
562
564
|
doc: "Color of the ambient light.",
|
|
563
565
|
"sdk-support": {
|
|
@@ -662,6 +664,7 @@ var properties_light_flat = {
|
|
|
662
664
|
"zoom"
|
|
663
665
|
]
|
|
664
666
|
},
|
|
667
|
+
"use-theme": true,
|
|
665
668
|
transition: true,
|
|
666
669
|
doc: "Color tint for lighting extruded geometries.",
|
|
667
670
|
"sdk-support": {
|
|
@@ -796,6 +799,7 @@ var source_vector = {
|
|
|
796
799
|
length: 4,
|
|
797
800
|
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]`."
|
|
798
801
|
},
|
|
802
|
+
experimental: true,
|
|
799
803
|
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."
|
|
800
804
|
},
|
|
801
805
|
scheme: {
|
|
@@ -885,6 +889,7 @@ var source_raster = {
|
|
|
885
889
|
length: 4,
|
|
886
890
|
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]`."
|
|
887
891
|
},
|
|
892
|
+
experimental: true,
|
|
888
893
|
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."
|
|
889
894
|
},
|
|
890
895
|
minzoom: {
|
|
@@ -976,6 +981,7 @@ var source_raster_dem = {
|
|
|
976
981
|
length: 4,
|
|
977
982
|
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]`."
|
|
978
983
|
},
|
|
984
|
+
experimental: true,
|
|
979
985
|
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."
|
|
980
986
|
},
|
|
981
987
|
minzoom: {
|
|
@@ -1068,6 +1074,7 @@ var source_raster_array = {
|
|
|
1068
1074
|
length: 4,
|
|
1069
1075
|
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]`."
|
|
1070
1076
|
},
|
|
1077
|
+
experimental: true,
|
|
1071
1078
|
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."
|
|
1072
1079
|
},
|
|
1073
1080
|
minzoom: {
|
|
@@ -1779,11 +1786,13 @@ var layout_fill = {
|
|
|
1779
1786
|
"sdk-support": {
|
|
1780
1787
|
"basic functionality": {
|
|
1781
1788
|
android: "11.11.0",
|
|
1782
|
-
ios: "11.11.0"
|
|
1789
|
+
ios: "11.11.0",
|
|
1790
|
+
js: "3.14.0"
|
|
1783
1791
|
},
|
|
1784
1792
|
"data-driven styling": {
|
|
1785
1793
|
android: "11.11.0",
|
|
1786
|
-
ios: "11.11.0"
|
|
1794
|
+
ios: "11.11.0",
|
|
1795
|
+
js: "3.14.0"
|
|
1787
1796
|
}
|
|
1788
1797
|
},
|
|
1789
1798
|
expression: {
|
|
@@ -1838,7 +1847,8 @@ var layout_circle = {
|
|
|
1838
1847
|
"sdk-support": {
|
|
1839
1848
|
"basic functionality": {
|
|
1840
1849
|
android: "11.11.0",
|
|
1841
|
-
ios: "11.11.0"
|
|
1850
|
+
ios: "11.11.0",
|
|
1851
|
+
js: "3.14.0"
|
|
1842
1852
|
}
|
|
1843
1853
|
},
|
|
1844
1854
|
expression: {
|
|
@@ -4577,6 +4587,18 @@ var expression_name = {
|
|
|
4577
4587
|
}
|
|
4578
4588
|
}
|
|
4579
4589
|
},
|
|
4590
|
+
worldview: {
|
|
4591
|
+
doc: "Returns the current worldview being used.",
|
|
4592
|
+
group: "Lookup",
|
|
4593
|
+
experimental: true,
|
|
4594
|
+
"sdk-support": {
|
|
4595
|
+
"basic functionality": {
|
|
4596
|
+
js: "3.13.0",
|
|
4597
|
+
android: "11.13.0",
|
|
4598
|
+
ios: "11.13.0"
|
|
4599
|
+
}
|
|
4600
|
+
}
|
|
4601
|
+
},
|
|
4580
4602
|
id: {
|
|
4581
4603
|
doc: "Returns the feature's id, if it has one.",
|
|
4582
4604
|
group: "Feature data",
|
|
@@ -5205,6 +5227,7 @@ var fog = {
|
|
|
5205
5227
|
],
|
|
5206
5228
|
relaxZoomRestriction: true
|
|
5207
5229
|
},
|
|
5230
|
+
"use-theme": true,
|
|
5208
5231
|
transition: true,
|
|
5209
5232
|
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.",
|
|
5210
5233
|
"sdk-support": {
|
|
@@ -5227,6 +5250,7 @@ var fog = {
|
|
|
5227
5250
|
],
|
|
5228
5251
|
relaxZoomRestriction: true
|
|
5229
5252
|
},
|
|
5253
|
+
"use-theme": true,
|
|
5230
5254
|
transition: true,
|
|
5231
5255
|
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.",
|
|
5232
5256
|
"sdk-support": {
|
|
@@ -5261,6 +5285,7 @@ var fog = {
|
|
|
5261
5285
|
],
|
|
5262
5286
|
relaxZoomRestriction: true
|
|
5263
5287
|
},
|
|
5288
|
+
"use-theme": true,
|
|
5264
5289
|
transition: true,
|
|
5265
5290
|
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.",
|
|
5266
5291
|
"sdk-support": {
|
|
@@ -5448,6 +5473,7 @@ var snow = {
|
|
|
5448
5473
|
],
|
|
5449
5474
|
relaxZoomRestriction: true
|
|
5450
5475
|
},
|
|
5476
|
+
"use-theme": true,
|
|
5451
5477
|
transition: true,
|
|
5452
5478
|
doc: "Snow particles color.",
|
|
5453
5479
|
"sdk-support": {
|
|
@@ -5533,6 +5559,7 @@ var snow = {
|
|
|
5533
5559
|
],
|
|
5534
5560
|
relaxZoomRestriction: true
|
|
5535
5561
|
},
|
|
5562
|
+
"use-theme": true,
|
|
5536
5563
|
transition: true,
|
|
5537
5564
|
doc: "Snow vignette screen-space corners tint color.",
|
|
5538
5565
|
"sdk-support": {
|
|
@@ -5717,6 +5744,7 @@ var rain = {
|
|
|
5717
5744
|
],
|
|
5718
5745
|
relaxZoomRestriction: true
|
|
5719
5746
|
},
|
|
5747
|
+
"use-theme": true,
|
|
5720
5748
|
transition: true,
|
|
5721
5749
|
doc: "Individual rain particle dorplets color.",
|
|
5722
5750
|
"sdk-support": {
|
|
@@ -5828,6 +5856,7 @@ var rain = {
|
|
|
5828
5856
|
],
|
|
5829
5857
|
relaxZoomRestriction: true
|
|
5830
5858
|
},
|
|
5859
|
+
"use-theme": true,
|
|
5831
5860
|
transition: true,
|
|
5832
5861
|
doc: "Rain vignette screen-space corners tint color.",
|
|
5833
5862
|
"sdk-support": {
|
|
@@ -6091,6 +6120,7 @@ var light = {
|
|
|
6091
6120
|
"zoom"
|
|
6092
6121
|
]
|
|
6093
6122
|
},
|
|
6123
|
+
"use-theme": true,
|
|
6094
6124
|
transition: true,
|
|
6095
6125
|
doc: "Color tint for lighting extruded geometries.",
|
|
6096
6126
|
"sdk-support": {
|
|
@@ -6339,6 +6369,7 @@ var paint_fill = {
|
|
|
6339
6369
|
type: "color",
|
|
6340
6370
|
"default": "#000000",
|
|
6341
6371
|
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.",
|
|
6372
|
+
"use-theme": true,
|
|
6342
6373
|
transition: true,
|
|
6343
6374
|
requires: [
|
|
6344
6375
|
{
|
|
@@ -6371,6 +6402,7 @@ var paint_fill = {
|
|
|
6371
6402
|
"fill-outline-color": {
|
|
6372
6403
|
type: "color",
|
|
6373
6404
|
doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
|
|
6405
|
+
"use-theme": true,
|
|
6374
6406
|
transition: true,
|
|
6375
6407
|
requires: [
|
|
6376
6408
|
{
|
|
@@ -6502,11 +6534,12 @@ var paint_fill = {
|
|
|
6502
6534
|
],
|
|
6503
6535
|
"sdk-support": {
|
|
6504
6536
|
"basic functionality": {
|
|
6505
|
-
js: "3.12.0"
|
|
6537
|
+
js: "3.12.0",
|
|
6538
|
+
android: "11.14.0",
|
|
6539
|
+
ios: "11.14.0"
|
|
6506
6540
|
}
|
|
6507
6541
|
},
|
|
6508
|
-
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."
|
|
6509
|
-
transition: true
|
|
6542
|
+
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)."
|
|
6510
6543
|
},
|
|
6511
6544
|
"fill-emissive-strength": {
|
|
6512
6545
|
type: "number",
|
|
@@ -6564,15 +6597,18 @@ var paint_fill = {
|
|
|
6564
6597
|
doc: "The color of bridge guard rail.",
|
|
6565
6598
|
experimental: true,
|
|
6566
6599
|
"private": true,
|
|
6600
|
+
"use-theme": true,
|
|
6567
6601
|
transition: true,
|
|
6568
6602
|
"sdk-support": {
|
|
6569
6603
|
"basic functionality": {
|
|
6570
6604
|
android: "11.11.0",
|
|
6571
|
-
ios: "11.11.0"
|
|
6605
|
+
ios: "11.11.0",
|
|
6606
|
+
js: "3.14.0"
|
|
6572
6607
|
},
|
|
6573
6608
|
"data-driven styling": {
|
|
6574
6609
|
android: "11.11.0",
|
|
6575
|
-
ios: "11.11.0"
|
|
6610
|
+
ios: "11.11.0",
|
|
6611
|
+
js: "3.14.0"
|
|
6576
6612
|
}
|
|
6577
6613
|
},
|
|
6578
6614
|
expression: {
|
|
@@ -6589,17 +6625,20 @@ var paint_fill = {
|
|
|
6589
6625
|
type: "color",
|
|
6590
6626
|
"default": "rgba(241, 236, 225, 255)",
|
|
6591
6627
|
doc: "The color of tunnel structures (tunnel entrance and tunnel walls).",
|
|
6628
|
+
"use-theme": true,
|
|
6592
6629
|
transition: true,
|
|
6593
6630
|
experimental: true,
|
|
6594
6631
|
"private": true,
|
|
6595
6632
|
"sdk-support": {
|
|
6596
6633
|
"basic functionality": {
|
|
6597
6634
|
android: "11.11.0",
|
|
6598
|
-
ios: "11.11.0"
|
|
6635
|
+
ios: "11.11.0",
|
|
6636
|
+
js: "3.14.0"
|
|
6599
6637
|
},
|
|
6600
6638
|
"data-driven styling": {
|
|
6601
6639
|
android: "11.11.0",
|
|
6602
|
-
ios: "11.11.0"
|
|
6640
|
+
ios: "11.11.0",
|
|
6641
|
+
js: "3.14.0"
|
|
6603
6642
|
}
|
|
6604
6643
|
},
|
|
6605
6644
|
expression: {
|
|
@@ -6757,6 +6796,8 @@ var paint_building = {
|
|
|
6757
6796
|
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`.",
|
|
6758
6797
|
experimental: true,
|
|
6759
6798
|
"private": true,
|
|
6799
|
+
"use-theme": true,
|
|
6800
|
+
transition: false,
|
|
6760
6801
|
"sdk-support": {
|
|
6761
6802
|
"basic functionality": {
|
|
6762
6803
|
},
|
|
@@ -6831,6 +6872,7 @@ var paint_line = {
|
|
|
6831
6872
|
type: "color",
|
|
6832
6873
|
doc: "The color with which the line will be drawn.",
|
|
6833
6874
|
"default": "#000000",
|
|
6875
|
+
"use-theme": true,
|
|
6834
6876
|
transition: true,
|
|
6835
6877
|
requires: [
|
|
6836
6878
|
{
|
|
@@ -7110,11 +7152,12 @@ var paint_line = {
|
|
|
7110
7152
|
],
|
|
7111
7153
|
"sdk-support": {
|
|
7112
7154
|
"basic functionality": {
|
|
7113
|
-
js: "3.12.0"
|
|
7155
|
+
js: "3.12.0",
|
|
7156
|
+
android: "11.14.0",
|
|
7157
|
+
ios: "11.14.0"
|
|
7114
7158
|
}
|
|
7115
7159
|
},
|
|
7116
|
-
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."
|
|
7117
|
-
transition: true
|
|
7160
|
+
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)."
|
|
7118
7161
|
},
|
|
7119
7162
|
"line-gradient": {
|
|
7120
7163
|
type: "color",
|
|
@@ -7140,6 +7183,7 @@ var paint_line = {
|
|
|
7140
7183
|
1,
|
|
7141
7184
|
"red"
|
|
7142
7185
|
],
|
|
7186
|
+
"use-theme": true,
|
|
7143
7187
|
transition: false,
|
|
7144
7188
|
requires: [
|
|
7145
7189
|
{
|
|
@@ -7253,6 +7297,7 @@ var paint_line = {
|
|
|
7253
7297
|
doc: "The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.",
|
|
7254
7298
|
experimental: true,
|
|
7255
7299
|
"default": "transparent",
|
|
7300
|
+
"use-theme": true,
|
|
7256
7301
|
transition: true,
|
|
7257
7302
|
requires: [
|
|
7258
7303
|
"line-trim-offset",
|
|
@@ -7339,6 +7384,7 @@ var paint_line = {
|
|
|
7339
7384
|
"private": true,
|
|
7340
7385
|
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.",
|
|
7341
7386
|
"default": "rgba(0, 0, 0, 0)",
|
|
7387
|
+
"use-theme": true,
|
|
7342
7388
|
transition: true,
|
|
7343
7389
|
"sdk-support": {
|
|
7344
7390
|
"basic functionality": {
|
|
@@ -7420,6 +7466,7 @@ var paint_circle = {
|
|
|
7420
7466
|
type: "color",
|
|
7421
7467
|
"default": "#000000",
|
|
7422
7468
|
doc: "The fill color of the circle.",
|
|
7469
|
+
"use-theme": true,
|
|
7423
7470
|
transition: true,
|
|
7424
7471
|
"sdk-support": {
|
|
7425
7472
|
"basic functionality": {
|
|
@@ -7646,6 +7693,7 @@ var paint_circle = {
|
|
|
7646
7693
|
type: "color",
|
|
7647
7694
|
"default": "#000000",
|
|
7648
7695
|
doc: "The stroke color of the circle.",
|
|
7696
|
+
"use-theme": true,
|
|
7649
7697
|
transition: true,
|
|
7650
7698
|
"sdk-support": {
|
|
7651
7699
|
"basic functionality": {
|
|
@@ -7832,6 +7880,7 @@ var paint_heatmap = {
|
|
|
7832
7880
|
"red"
|
|
7833
7881
|
],
|
|
7834
7882
|
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.",
|
|
7883
|
+
"use-theme": true,
|
|
7835
7884
|
transition: false,
|
|
7836
7885
|
"sdk-support": {
|
|
7837
7886
|
"basic functionality": {
|
|
@@ -8007,6 +8056,7 @@ var paint_symbol = {
|
|
|
8007
8056
|
"icon-color": {
|
|
8008
8057
|
type: "color",
|
|
8009
8058
|
"default": "#000000",
|
|
8059
|
+
"use-theme": true,
|
|
8010
8060
|
transition: true,
|
|
8011
8061
|
doc: "The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",
|
|
8012
8062
|
requires: [
|
|
@@ -8038,6 +8088,7 @@ var paint_symbol = {
|
|
|
8038
8088
|
"icon-halo-color": {
|
|
8039
8089
|
type: "color",
|
|
8040
8090
|
"default": "rgba(0, 0, 0, 0)",
|
|
8091
|
+
"use-theme": true,
|
|
8041
8092
|
transition: true,
|
|
8042
8093
|
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/).",
|
|
8043
8094
|
requires: [
|
|
@@ -8215,8 +8266,7 @@ var paint_symbol = {
|
|
|
8215
8266
|
ios: "11.0.0"
|
|
8216
8267
|
}
|
|
8217
8268
|
},
|
|
8218
|
-
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."
|
|
8219
|
-
transition: true
|
|
8269
|
+
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)."
|
|
8220
8270
|
},
|
|
8221
8271
|
"text-opacity": {
|
|
8222
8272
|
type: "number",
|
|
@@ -8288,6 +8338,7 @@ var paint_symbol = {
|
|
|
8288
8338
|
type: "color",
|
|
8289
8339
|
doc: "The color with which the text will be drawn.",
|
|
8290
8340
|
"default": "#000000",
|
|
8341
|
+
"use-theme": true,
|
|
8291
8342
|
transition: true,
|
|
8292
8343
|
overridable: true,
|
|
8293
8344
|
requires: [
|
|
@@ -8319,6 +8370,7 @@ var paint_symbol = {
|
|
|
8319
8370
|
"text-halo-color": {
|
|
8320
8371
|
type: "color",
|
|
8321
8372
|
"default": "rgba(0, 0, 0, 0)",
|
|
8373
|
+
"use-theme": true,
|
|
8322
8374
|
transition: true,
|
|
8323
8375
|
doc: "The color of the text's halo, which helps it stand out from backgrounds.",
|
|
8324
8376
|
requires: [
|
|
@@ -8604,6 +8656,7 @@ var paint_raster = {
|
|
|
8604
8656
|
"raster-color": {
|
|
8605
8657
|
type: "color",
|
|
8606
8658
|
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`.",
|
|
8659
|
+
"use-theme": true,
|
|
8607
8660
|
transition: false,
|
|
8608
8661
|
"sdk-support": {
|
|
8609
8662
|
"basic functionality": {
|
|
@@ -8991,6 +9044,7 @@ var paint_hillshade = {
|
|
|
8991
9044
|
type: "color",
|
|
8992
9045
|
"default": "#000000",
|
|
8993
9046
|
doc: "The shading color of areas that face away from the light source.",
|
|
9047
|
+
"use-theme": true,
|
|
8994
9048
|
transition: true,
|
|
8995
9049
|
"sdk-support": {
|
|
8996
9050
|
"basic functionality": {
|
|
@@ -9012,6 +9066,7 @@ var paint_hillshade = {
|
|
|
9012
9066
|
type: "color",
|
|
9013
9067
|
"default": "#FFFFFF",
|
|
9014
9068
|
doc: "The shading color of areas that faces towards the light source.",
|
|
9069
|
+
"use-theme": true,
|
|
9015
9070
|
transition: true,
|
|
9016
9071
|
"sdk-support": {
|
|
9017
9072
|
"basic functionality": {
|
|
@@ -9033,6 +9088,7 @@ var paint_hillshade = {
|
|
|
9033
9088
|
type: "color",
|
|
9034
9089
|
"default": "#000000",
|
|
9035
9090
|
doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
|
|
9091
|
+
"use-theme": true,
|
|
9036
9092
|
transition: true,
|
|
9037
9093
|
"sdk-support": {
|
|
9038
9094
|
"basic functionality": {
|
|
@@ -9109,6 +9165,7 @@ var paint_background = {
|
|
|
9109
9165
|
type: "color",
|
|
9110
9166
|
"default": "#000000",
|
|
9111
9167
|
doc: "The color with which the background will be drawn.",
|
|
9168
|
+
"use-theme": true,
|
|
9112
9169
|
transition: true,
|
|
9113
9170
|
requires: [
|
|
9114
9171
|
{
|
|
@@ -9364,6 +9421,7 @@ var paint_sky = {
|
|
|
9364
9421
|
"white"
|
|
9365
9422
|
],
|
|
9366
9423
|
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`.",
|
|
9424
|
+
"use-theme": true,
|
|
9367
9425
|
transition: false,
|
|
9368
9426
|
requires: [
|
|
9369
9427
|
{
|
|
@@ -9391,6 +9449,7 @@ var paint_sky = {
|
|
|
9391
9449
|
type: "color",
|
|
9392
9450
|
"default": "white",
|
|
9393
9451
|
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.",
|
|
9452
|
+
"use-theme": true,
|
|
9394
9453
|
transition: false,
|
|
9395
9454
|
requires: [
|
|
9396
9455
|
{
|
|
@@ -9410,6 +9469,7 @@ var paint_sky = {
|
|
|
9410
9469
|
type: "color",
|
|
9411
9470
|
"default": "white",
|
|
9412
9471
|
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.",
|
|
9472
|
+
"use-theme": true,
|
|
9413
9473
|
transition: false,
|
|
9414
9474
|
requires: [
|
|
9415
9475
|
{
|
|
@@ -9605,6 +9665,7 @@ var paint_model = {
|
|
|
9605
9665
|
ios: "11.0.0"
|
|
9606
9666
|
}
|
|
9607
9667
|
},
|
|
9668
|
+
"use-theme": true,
|
|
9608
9669
|
transition: true
|
|
9609
9670
|
},
|
|
9610
9671
|
"model-color-mix-intensity": {
|
|
@@ -9877,6 +9938,25 @@ var promoteId = {
|
|
|
9877
9938
|
doc: "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state."
|
|
9878
9939
|
}
|
|
9879
9940
|
};
|
|
9941
|
+
var $doc = {
|
|
9942
|
+
transition: {
|
|
9943
|
+
type: "transition",
|
|
9944
|
+
doc: "Controls how a property transitions to a new value. Overrides the style's root `transition` for this property."
|
|
9945
|
+
},
|
|
9946
|
+
"use-theme": {
|
|
9947
|
+
type: "enum",
|
|
9948
|
+
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.",
|
|
9949
|
+
values: {
|
|
9950
|
+
"default": {
|
|
9951
|
+
doc: "The color theme is applied to this property (default behavior)."
|
|
9952
|
+
},
|
|
9953
|
+
none: {
|
|
9954
|
+
doc: "The color theme is ignored for this property."
|
|
9955
|
+
}
|
|
9956
|
+
},
|
|
9957
|
+
"default": "default"
|
|
9958
|
+
}
|
|
9959
|
+
};
|
|
9880
9960
|
var v8 = {
|
|
9881
9961
|
$version: $version,
|
|
9882
9962
|
$root: $root,
|
|
@@ -10223,6 +10303,7 @@ var v8 = {
|
|
|
10223
10303
|
type: "color",
|
|
10224
10304
|
"default": "#000000",
|
|
10225
10305
|
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.",
|
|
10306
|
+
"use-theme": true,
|
|
10226
10307
|
transition: true,
|
|
10227
10308
|
requires: [
|
|
10228
10309
|
{
|
|
@@ -10351,11 +10432,12 @@ var v8 = {
|
|
|
10351
10432
|
],
|
|
10352
10433
|
"sdk-support": {
|
|
10353
10434
|
"basic functionality": {
|
|
10354
|
-
js: "3.12.0"
|
|
10435
|
+
js: "3.12.0",
|
|
10436
|
+
android: "11.14.0",
|
|
10437
|
+
ios: "11.14.0"
|
|
10355
10438
|
}
|
|
10356
10439
|
},
|
|
10357
|
-
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."
|
|
10358
|
-
transition: true
|
|
10440
|
+
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)."
|
|
10359
10441
|
},
|
|
10360
10442
|
"fill-extrusion-height": {
|
|
10361
10443
|
type: "number",
|
|
@@ -10620,6 +10702,7 @@ var v8 = {
|
|
|
10620
10702
|
requires: [
|
|
10621
10703
|
"lights"
|
|
10622
10704
|
],
|
|
10705
|
+
"use-theme": true,
|
|
10623
10706
|
transition: true,
|
|
10624
10707
|
expression: {
|
|
10625
10708
|
interpolated: true,
|
|
@@ -10935,6 +11018,7 @@ var v8 = {
|
|
|
10935
11018
|
"raster-particle-color": {
|
|
10936
11019
|
type: "color",
|
|
10937
11020
|
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`.",
|
|
11021
|
+
"use-theme": true,
|
|
10938
11022
|
transition: false,
|
|
10939
11023
|
"sdk-support": {
|
|
10940
11024
|
"basic functionality": {
|
|
@@ -11073,7 +11157,8 @@ var v8 = {
|
|
|
11073
11157
|
doc: "Property is constant across all zoom levels and property values."
|
|
11074
11158
|
}
|
|
11075
11159
|
},
|
|
11076
|
-
promoteId: promoteId
|
|
11160
|
+
promoteId: promoteId,
|
|
11161
|
+
$doc: $doc
|
|
11077
11162
|
};
|
|
11078
11163
|
|
|
11079
11164
|
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
@@ -11496,6 +11581,13 @@ function isValidNativeType(provided, allowedTypes) {
|
|
|
11496
11581
|
}
|
|
11497
11582
|
});
|
|
11498
11583
|
}
|
|
11584
|
+
function typeEquals(a, b) {
|
|
11585
|
+
if (a.kind === 'array' && b.kind === 'array') {
|
|
11586
|
+
return a.N === b.N && typeEquals(a.itemType, b.itemType);
|
|
11587
|
+
} else {
|
|
11588
|
+
return a.kind === b.kind;
|
|
11589
|
+
}
|
|
11590
|
+
}
|
|
11499
11591
|
|
|
11500
11592
|
function getDefaultExportFromCjs (x) {
|
|
11501
11593
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -12566,15 +12658,11 @@ function array(from, to, t) {
|
|
|
12566
12658
|
return number(d, to[i], t);
|
|
12567
12659
|
});
|
|
12568
12660
|
}
|
|
12569
|
-
function easeIn(x) {
|
|
12570
|
-
return x * x * x * x * x;
|
|
12571
|
-
}
|
|
12572
12661
|
|
|
12573
12662
|
var interpolate$1 = /*#__PURE__*/Object.freeze({
|
|
12574
12663
|
__proto__: null,
|
|
12575
12664
|
array: array,
|
|
12576
12665
|
color: color,
|
|
12577
|
-
easeIn: easeIn,
|
|
12578
12666
|
number: number
|
|
12579
12667
|
});
|
|
12580
12668
|
|
|
@@ -12603,7 +12691,7 @@ class Color {
|
|
|
12603
12691
|
if (!rgba) {
|
|
12604
12692
|
return void 0;
|
|
12605
12693
|
}
|
|
12606
|
-
return new Color(rgba[0] / 255
|
|
12694
|
+
return new Color(rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3]);
|
|
12607
12695
|
}
|
|
12608
12696
|
/**
|
|
12609
12697
|
* Returns an RGBA string representing the color value.
|
|
@@ -12615,20 +12703,6 @@ class Color {
|
|
|
12615
12703
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
12616
12704
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
12617
12705
|
*/
|
|
12618
|
-
toStringPremultipliedAlpha() {
|
|
12619
|
-
const [r, g, b, a] = this.a === 0 ? [
|
|
12620
|
-
0,
|
|
12621
|
-
0,
|
|
12622
|
-
0,
|
|
12623
|
-
0
|
|
12624
|
-
] : [
|
|
12625
|
-
this.r * 255 / this.a,
|
|
12626
|
-
this.g * 255 / this.a,
|
|
12627
|
-
this.b * 255 / this.a,
|
|
12628
|
-
this.a
|
|
12629
|
-
];
|
|
12630
|
-
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
12631
|
-
}
|
|
12632
12706
|
toString() {
|
|
12633
12707
|
const [r, g, b, a] = [
|
|
12634
12708
|
this.r,
|
|
@@ -12638,16 +12712,22 @@ class Color {
|
|
|
12638
12712
|
];
|
|
12639
12713
|
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
12640
12714
|
}
|
|
12641
|
-
|
|
12715
|
+
toNonPremultipliedRenderColor(lut) {
|
|
12642
12716
|
const {r, g, b, a} = this;
|
|
12643
|
-
return new
|
|
12717
|
+
return new NonPremultipliedRenderColor(lut, r, g, b, a);
|
|
12718
|
+
}
|
|
12719
|
+
toPremultipliedRenderColor(lut) {
|
|
12720
|
+
const {r, g, b, a} = this;
|
|
12721
|
+
return new PremultipliedRenderColor(lut, r * a, g * a, b * a, a);
|
|
12644
12722
|
}
|
|
12645
12723
|
clone() {
|
|
12646
12724
|
return new Color(this.r, this.g, this.b, this.a);
|
|
12647
12725
|
}
|
|
12648
12726
|
}
|
|
12649
12727
|
class RenderColor {
|
|
12650
|
-
constructor(lut, r, g, b, a) {
|
|
12728
|
+
constructor(lut, r, g, b, a, premultiplied = false) {
|
|
12729
|
+
this.premultiplied = false;
|
|
12730
|
+
this.premultiplied = premultiplied;
|
|
12651
12731
|
if (!lut) {
|
|
12652
12732
|
this.r = r;
|
|
12653
12733
|
this.g = g;
|
|
@@ -12656,9 +12736,15 @@ class RenderColor {
|
|
|
12656
12736
|
} else {
|
|
12657
12737
|
const N = lut.image.height;
|
|
12658
12738
|
const N2 = N * N;
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12739
|
+
if (this.premultiplied) {
|
|
12740
|
+
r = a === 0 ? 0 : r / a * (N - 1);
|
|
12741
|
+
g = a === 0 ? 0 : g / a * (N - 1);
|
|
12742
|
+
b = a === 0 ? 0 : b / a * (N - 1);
|
|
12743
|
+
} else {
|
|
12744
|
+
r = r * (N - 1);
|
|
12745
|
+
g = g * (N - 1);
|
|
12746
|
+
b = b * (N - 1);
|
|
12747
|
+
}
|
|
12662
12748
|
const r0 = Math.floor(r);
|
|
12663
12749
|
const g0 = Math.floor(g);
|
|
12664
12750
|
const b0 = Math.floor(b);
|
|
@@ -12680,49 +12766,46 @@ class RenderColor {
|
|
|
12680
12766
|
if (i0 < 0 || i7 >= data.length) {
|
|
12681
12767
|
throw new Error('out of range');
|
|
12682
12768
|
}
|
|
12683
|
-
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;
|
|
12684
|
-
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;
|
|
12685
|
-
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;
|
|
12769
|
+
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);
|
|
12770
|
+
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);
|
|
12771
|
+
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);
|
|
12686
12772
|
this.a = a;
|
|
12687
12773
|
}
|
|
12688
12774
|
}
|
|
12689
12775
|
/**
|
|
12690
|
-
* Returns an RGBA array of values representing the color
|
|
12691
|
-
*
|
|
12776
|
+
* Returns an RGBA array of values representing the color.
|
|
12692
12777
|
* @returns An array of RGBA color values in the range [0, 255].
|
|
12693
12778
|
*/
|
|
12694
12779
|
toArray() {
|
|
12695
12780
|
const {r, g, b, a} = this;
|
|
12696
|
-
return
|
|
12697
|
-
|
|
12698
|
-
|
|
12699
|
-
|
|
12700
|
-
0
|
|
12701
|
-
] : [
|
|
12702
|
-
r * 255 / a,
|
|
12703
|
-
g * 255 / a,
|
|
12704
|
-
b * 255 / a,
|
|
12781
|
+
return [
|
|
12782
|
+
r * 255,
|
|
12783
|
+
g * 255,
|
|
12784
|
+
b * 255,
|
|
12705
12785
|
a
|
|
12706
12786
|
];
|
|
12707
12787
|
}
|
|
12708
12788
|
/**
|
|
12709
12789
|
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
12710
|
-
*
|
|
12711
12790
|
* @returns An array of HSLA color values.
|
|
12712
12791
|
*/
|
|
12713
12792
|
toHslaArray() {
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12793
|
+
let {r, g, b, a} = this;
|
|
12794
|
+
if (this.premultiplied) {
|
|
12795
|
+
if (a === 0)
|
|
12796
|
+
return [
|
|
12797
|
+
0,
|
|
12798
|
+
0,
|
|
12799
|
+
0,
|
|
12800
|
+
0
|
|
12801
|
+
];
|
|
12802
|
+
r /= a;
|
|
12803
|
+
g /= a;
|
|
12804
|
+
b /= a;
|
|
12721
12805
|
}
|
|
12722
|
-
const
|
|
12723
|
-
const
|
|
12724
|
-
const
|
|
12725
|
-
const blue = Math.min(Math.max(b / a, 0), 1);
|
|
12806
|
+
const red = Math.min(Math.max(r, 0), 1);
|
|
12807
|
+
const green = Math.min(Math.max(g, 0), 1);
|
|
12808
|
+
const blue = Math.min(Math.max(b, 0), 1);
|
|
12726
12809
|
const min = Math.min(red, green, blue);
|
|
12727
12810
|
const max = Math.max(red, green, blue);
|
|
12728
12811
|
const l = (min + max) / 2;
|
|
@@ -12753,21 +12836,16 @@ class RenderColor {
|
|
|
12753
12836
|
];
|
|
12754
12837
|
}
|
|
12755
12838
|
/**
|
|
12756
|
-
* Returns a RGBA array of float values representing the color
|
|
12839
|
+
* Returns a RGBA array of float values representing the color.
|
|
12757
12840
|
*
|
|
12758
12841
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12759
12842
|
*/
|
|
12760
12843
|
toArray01() {
|
|
12761
12844
|
const {r, g, b, a} = this;
|
|
12762
|
-
return
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
0
|
|
12767
|
-
] : [
|
|
12768
|
-
r / a,
|
|
12769
|
-
g / a,
|
|
12770
|
-
b / a,
|
|
12845
|
+
return [
|
|
12846
|
+
r,
|
|
12847
|
+
g,
|
|
12848
|
+
b,
|
|
12771
12849
|
a
|
|
12772
12850
|
];
|
|
12773
12851
|
}
|
|
@@ -12778,52 +12856,39 @@ class RenderColor {
|
|
|
12778
12856
|
* @returns An array of RGB color values in the range [0, 1].
|
|
12779
12857
|
*/
|
|
12780
12858
|
toArray01Scaled(scale) {
|
|
12781
|
-
const {r, g, b
|
|
12782
|
-
return a === 0 ? [
|
|
12783
|
-
0,
|
|
12784
|
-
0,
|
|
12785
|
-
0
|
|
12786
|
-
] : [
|
|
12787
|
-
r / a * scale,
|
|
12788
|
-
g / a * scale,
|
|
12789
|
-
b / a * scale
|
|
12790
|
-
];
|
|
12791
|
-
}
|
|
12792
|
-
/**
|
|
12793
|
-
* Returns an RGBA array of values representing the color, premultiplied by A.
|
|
12794
|
-
*
|
|
12795
|
-
* @returns An array of RGBA color values in the range [0, 1].
|
|
12796
|
-
*/
|
|
12797
|
-
toArray01PremultipliedAlpha() {
|
|
12798
|
-
const {r, g, b, a} = this;
|
|
12859
|
+
const {r, g, b} = this;
|
|
12799
12860
|
return [
|
|
12800
|
-
r,
|
|
12801
|
-
g,
|
|
12802
|
-
b
|
|
12803
|
-
a
|
|
12861
|
+
r * scale,
|
|
12862
|
+
g * scale,
|
|
12863
|
+
b * scale
|
|
12804
12864
|
];
|
|
12805
12865
|
}
|
|
12806
12866
|
/**
|
|
12807
|
-
* Returns an RGBA array of values representing the color
|
|
12808
|
-
* The color is defined by sRGB primaries, but the sRGB transfer function
|
|
12809
|
-
*
|
|
12867
|
+
* Returns an RGBA array of values representing the color converted to linear color space.
|
|
12868
|
+
* The color is defined by sRGB primaries, but the sRGB transfer function
|
|
12869
|
+
* is reversed to obtain linear energy.
|
|
12810
12870
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12811
12871
|
*/
|
|
12812
12872
|
toArray01Linear() {
|
|
12813
12873
|
const {r, g, b, a} = this;
|
|
12814
|
-
return
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
0
|
|
12819
|
-
] : [
|
|
12820
|
-
Math.pow(r / a, 2.2),
|
|
12821
|
-
Math.pow(g / a, 2.2),
|
|
12822
|
-
Math.pow(b / a, 2.2),
|
|
12874
|
+
return [
|
|
12875
|
+
Math.pow(r, 2.2),
|
|
12876
|
+
Math.pow(g, 2.2),
|
|
12877
|
+
Math.pow(b, 2.2),
|
|
12823
12878
|
a
|
|
12824
12879
|
];
|
|
12825
12880
|
}
|
|
12826
12881
|
}
|
|
12882
|
+
class NonPremultipliedRenderColor extends RenderColor {
|
|
12883
|
+
constructor(lut, r, g, b, a) {
|
|
12884
|
+
super(lut, r, g, b, a, false);
|
|
12885
|
+
}
|
|
12886
|
+
}
|
|
12887
|
+
class PremultipliedRenderColor extends RenderColor {
|
|
12888
|
+
constructor(lut, r, g, b, a) {
|
|
12889
|
+
super(lut, r, g, b, a, true);
|
|
12890
|
+
}
|
|
12891
|
+
}
|
|
12827
12892
|
Color.black = new Color(0, 0, 0, 1);
|
|
12828
12893
|
Color.white = new Color(1, 1, 1, 1);
|
|
12829
12894
|
Color.transparent = new Color(0, 0, 0, 0);
|
|
@@ -12912,7 +12977,7 @@ class Formatted {
|
|
|
12912
12977
|
options['font-scale'] = section.scale;
|
|
12913
12978
|
}
|
|
12914
12979
|
if (section.textColor) {
|
|
12915
|
-
options['text-color'] = ['rgba'].concat(section.textColor.
|
|
12980
|
+
options['text-color'] = ['rgba'].concat(section.textColor.toNonPremultipliedRenderColor(null).toArray());
|
|
12916
12981
|
}
|
|
12917
12982
|
serialized.push(options);
|
|
12918
12983
|
}
|
|
@@ -13210,9 +13275,7 @@ function toString(value) {
|
|
|
13210
13275
|
return '';
|
|
13211
13276
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
13212
13277
|
return String(value);
|
|
13213
|
-
} else if (value instanceof Color) {
|
|
13214
|
-
return value.toStringPremultipliedAlpha();
|
|
13215
|
-
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
13278
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage || value instanceof Color) {
|
|
13216
13279
|
return value.toString();
|
|
13217
13280
|
} else {
|
|
13218
13281
|
return JSON.stringify(value);
|
|
@@ -13252,7 +13315,7 @@ class Literal {
|
|
|
13252
13315
|
this.value
|
|
13253
13316
|
];
|
|
13254
13317
|
} else if (this.value instanceof Color) {
|
|
13255
|
-
return ['rgba'].concat(this.value.
|
|
13318
|
+
return ['rgba'].concat(this.value.toNonPremultipliedRenderColor(null).toArray());
|
|
13256
13319
|
} else if (this.value instanceof Formatted) {
|
|
13257
13320
|
return this.value.serialize();
|
|
13258
13321
|
} else {
|
|
@@ -13418,7 +13481,7 @@ class FormatExpression {
|
|
|
13418
13481
|
evaluate(ctx) {
|
|
13419
13482
|
const evaluateSection = section => {
|
|
13420
13483
|
const evaluatedContent = section.content.evaluate(ctx);
|
|
13421
|
-
if (typeOf(evaluatedContent)
|
|
13484
|
+
if (typeEquals(typeOf(evaluatedContent), ResolvedImageType)) {
|
|
13422
13485
|
return new FormattedSection('', evaluatedContent, null, null, null);
|
|
13423
13486
|
}
|
|
13424
13487
|
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);
|
|
@@ -13925,7 +13988,7 @@ class CompoundExpression {
|
|
|
13925
13988
|
continue;
|
|
13926
13989
|
overloadParams.push(params);
|
|
13927
13990
|
overloadIndex++;
|
|
13928
|
-
signatureContext = new ParsingContext
|
|
13991
|
+
signatureContext = new ParsingContext(context.registry, context.path, null, context.scope, void 0, context._scope, context.options);
|
|
13929
13992
|
const parsedArgs = [];
|
|
13930
13993
|
let argParseFailed = false;
|
|
13931
13994
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15819,6 +15882,89 @@ class Distance {
|
|
|
15819
15882
|
}
|
|
15820
15883
|
}
|
|
15821
15884
|
|
|
15885
|
+
function isFeatureConstant(e) {
|
|
15886
|
+
if (e instanceof CompoundExpression) {
|
|
15887
|
+
if (e.name === 'get' && e.args.length === 1) {
|
|
15888
|
+
return false;
|
|
15889
|
+
} else if (e.name === 'feature-state') {
|
|
15890
|
+
return false;
|
|
15891
|
+
} else if (e.name === 'has' && e.args.length === 1) {
|
|
15892
|
+
return false;
|
|
15893
|
+
} else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {
|
|
15894
|
+
return false;
|
|
15895
|
+
} else if (/^filter-/.test(e.name)) {
|
|
15896
|
+
return false;
|
|
15897
|
+
}
|
|
15898
|
+
}
|
|
15899
|
+
if (e instanceof Within) {
|
|
15900
|
+
return false;
|
|
15901
|
+
}
|
|
15902
|
+
if (e instanceof Distance) {
|
|
15903
|
+
return false;
|
|
15904
|
+
}
|
|
15905
|
+
if (e instanceof Config) {
|
|
15906
|
+
return e.featureConstant;
|
|
15907
|
+
}
|
|
15908
|
+
let result = true;
|
|
15909
|
+
e.eachChild(arg => {
|
|
15910
|
+
if (result && !isFeatureConstant(arg)) {
|
|
15911
|
+
result = false;
|
|
15912
|
+
}
|
|
15913
|
+
});
|
|
15914
|
+
return result;
|
|
15915
|
+
}
|
|
15916
|
+
function isStateConstant(e) {
|
|
15917
|
+
if (e instanceof CompoundExpression) {
|
|
15918
|
+
if (e.name === 'feature-state') {
|
|
15919
|
+
return false;
|
|
15920
|
+
}
|
|
15921
|
+
}
|
|
15922
|
+
let result = true;
|
|
15923
|
+
e.eachChild(arg => {
|
|
15924
|
+
if (result && !isStateConstant(arg)) {
|
|
15925
|
+
result = false;
|
|
15926
|
+
}
|
|
15927
|
+
});
|
|
15928
|
+
return result;
|
|
15929
|
+
}
|
|
15930
|
+
function getConfigDependencies(e) {
|
|
15931
|
+
if (e instanceof Config) {
|
|
15932
|
+
const singleConfig = /* @__PURE__ */
|
|
15933
|
+
new Set([e.key]);
|
|
15934
|
+
return singleConfig;
|
|
15935
|
+
}
|
|
15936
|
+
let result = /* @__PURE__ */
|
|
15937
|
+
new Set();
|
|
15938
|
+
e.eachChild(arg => {
|
|
15939
|
+
result = /* @__PURE__ */
|
|
15940
|
+
new Set([
|
|
15941
|
+
...result,
|
|
15942
|
+
...getConfigDependencies(arg)
|
|
15943
|
+
]);
|
|
15944
|
+
});
|
|
15945
|
+
return result;
|
|
15946
|
+
}
|
|
15947
|
+
function isGlobalPropertyConstant(e, properties) {
|
|
15948
|
+
if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
|
|
15949
|
+
return false;
|
|
15950
|
+
}
|
|
15951
|
+
let result = true;
|
|
15952
|
+
e.eachChild(arg => {
|
|
15953
|
+
if (result && !isGlobalPropertyConstant(arg, properties)) {
|
|
15954
|
+
result = false;
|
|
15955
|
+
}
|
|
15956
|
+
});
|
|
15957
|
+
return result;
|
|
15958
|
+
}
|
|
15959
|
+
|
|
15960
|
+
const FQIDSeparator = '\x1F';
|
|
15961
|
+
function makeConfigFQID(id, ownScope, contextScope) {
|
|
15962
|
+
return [
|
|
15963
|
+
id,
|
|
15964
|
+
ownScope,
|
|
15965
|
+
contextScope
|
|
15966
|
+
].filter(Boolean).join(FQIDSeparator);
|
|
15967
|
+
}
|
|
15822
15968
|
function coerceValue(type, value) {
|
|
15823
15969
|
switch (type) {
|
|
15824
15970
|
case 'string':
|
|
@@ -15851,10 +15997,11 @@ function clampToAllowedNumber(value, min, max, step) {
|
|
|
15851
15997
|
return value;
|
|
15852
15998
|
}
|
|
15853
15999
|
class Config {
|
|
15854
|
-
constructor(type, key, scope) {
|
|
16000
|
+
constructor(type, key, scope, featureConstant = false) {
|
|
15855
16001
|
this.type = type;
|
|
15856
16002
|
this.key = key;
|
|
15857
16003
|
this.scope = scope;
|
|
16004
|
+
this.featureConstant = featureConstant;
|
|
15858
16005
|
}
|
|
15859
16006
|
static parse(args, context) {
|
|
15860
16007
|
let type = context.expectedType;
|
|
@@ -15868,24 +16015,29 @@ class Config {
|
|
|
15868
16015
|
if (!(configKey instanceof Literal)) {
|
|
15869
16016
|
return context.error(`Key name of 'config' expression must be a string literal.`);
|
|
15870
16017
|
}
|
|
16018
|
+
let featureConstant = true;
|
|
16019
|
+
let configScopeValue;
|
|
16020
|
+
const configKeyValue = toString(configKey.value);
|
|
15871
16021
|
if (args.length >= 3) {
|
|
15872
16022
|
const configScope = context.parse(args[2], 2);
|
|
15873
16023
|
if (!(configScope instanceof Literal)) {
|
|
15874
16024
|
return context.error(`Scope of 'config' expression must be a string literal.`);
|
|
15875
16025
|
}
|
|
15876
|
-
|
|
16026
|
+
configScopeValue = toString(configScope.value);
|
|
15877
16027
|
}
|
|
15878
|
-
|
|
16028
|
+
if (context.options) {
|
|
16029
|
+
const fqid = makeConfigFQID(configKeyValue, configScopeValue, context._scope);
|
|
16030
|
+
const config = context.options.get(fqid);
|
|
16031
|
+
if (config) {
|
|
16032
|
+
featureConstant = isFeatureConstant(config.value || config.default);
|
|
16033
|
+
}
|
|
16034
|
+
}
|
|
16035
|
+
return new Config(type, configKeyValue, configScopeValue, featureConstant);
|
|
15879
16036
|
}
|
|
15880
16037
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15881
16038
|
evaluate(ctx) {
|
|
15882
|
-
const
|
|
15883
|
-
const
|
|
15884
|
-
this.key,
|
|
15885
|
-
this.scope,
|
|
15886
|
-
ctx.scope
|
|
15887
|
-
].filter(Boolean).join(FQIDSeparator);
|
|
15888
|
-
const config = ctx.getConfig(configKey);
|
|
16039
|
+
const fqid = makeConfigFQID(this.key, this.scope, ctx.scope);
|
|
16040
|
+
const config = ctx.getConfig(fqid);
|
|
15889
16041
|
if (!config)
|
|
15890
16042
|
return null;
|
|
15891
16043
|
const {type, value, values, minValue, maxValue, stepValue} = config;
|
|
@@ -15913,7 +16065,7 @@ class Config {
|
|
|
15913
16065
|
result = coerceValue(type, result);
|
|
15914
16066
|
}
|
|
15915
16067
|
}
|
|
15916
|
-
if (type && type !== this.type || result !== void 0 && typeOf(result)
|
|
16068
|
+
if (type && type !== this.type || result !== void 0 && !typeEquals(typeOf(result), this.type)) {
|
|
15917
16069
|
result = coerceValue(this.type.kind, result);
|
|
15918
16070
|
}
|
|
15919
16071
|
return result;
|
|
@@ -15929,84 +16081,12 @@ class Config {
|
|
|
15929
16081
|
this.key
|
|
15930
16082
|
];
|
|
15931
16083
|
if (this.scope) {
|
|
15932
|
-
res.concat(this.
|
|
16084
|
+
res.concat(this.scope);
|
|
15933
16085
|
}
|
|
15934
16086
|
return res;
|
|
15935
16087
|
}
|
|
15936
16088
|
}
|
|
15937
16089
|
|
|
15938
|
-
function isFeatureConstant(e) {
|
|
15939
|
-
if (e instanceof CompoundExpression) {
|
|
15940
|
-
if (e.name === 'get' && e.args.length === 1) {
|
|
15941
|
-
return false;
|
|
15942
|
-
} else if (e.name === 'feature-state') {
|
|
15943
|
-
return false;
|
|
15944
|
-
} else if (e.name === 'has' && e.args.length === 1) {
|
|
15945
|
-
return false;
|
|
15946
|
-
} else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {
|
|
15947
|
-
return false;
|
|
15948
|
-
} else if (/^filter-/.test(e.name)) {
|
|
15949
|
-
return false;
|
|
15950
|
-
}
|
|
15951
|
-
}
|
|
15952
|
-
if (e instanceof Within) {
|
|
15953
|
-
return false;
|
|
15954
|
-
}
|
|
15955
|
-
if (e instanceof Distance) {
|
|
15956
|
-
return false;
|
|
15957
|
-
}
|
|
15958
|
-
let result = true;
|
|
15959
|
-
e.eachChild(arg => {
|
|
15960
|
-
if (result && !isFeatureConstant(arg)) {
|
|
15961
|
-
result = false;
|
|
15962
|
-
}
|
|
15963
|
-
});
|
|
15964
|
-
return result;
|
|
15965
|
-
}
|
|
15966
|
-
function isStateConstant(e) {
|
|
15967
|
-
if (e instanceof CompoundExpression) {
|
|
15968
|
-
if (e.name === 'feature-state') {
|
|
15969
|
-
return false;
|
|
15970
|
-
}
|
|
15971
|
-
}
|
|
15972
|
-
let result = true;
|
|
15973
|
-
e.eachChild(arg => {
|
|
15974
|
-
if (result && !isStateConstant(arg)) {
|
|
15975
|
-
result = false;
|
|
15976
|
-
}
|
|
15977
|
-
});
|
|
15978
|
-
return result;
|
|
15979
|
-
}
|
|
15980
|
-
function getConfigDependencies(e) {
|
|
15981
|
-
if (e instanceof Config) {
|
|
15982
|
-
const singleConfig = /* @__PURE__ */
|
|
15983
|
-
new Set([e.key]);
|
|
15984
|
-
return singleConfig;
|
|
15985
|
-
}
|
|
15986
|
-
let result = /* @__PURE__ */
|
|
15987
|
-
new Set();
|
|
15988
|
-
e.eachChild(arg => {
|
|
15989
|
-
result = /* @__PURE__ */
|
|
15990
|
-
new Set([
|
|
15991
|
-
...result,
|
|
15992
|
-
...getConfigDependencies(arg)
|
|
15993
|
-
]);
|
|
15994
|
-
});
|
|
15995
|
-
return result;
|
|
15996
|
-
}
|
|
15997
|
-
function isGlobalPropertyConstant(e, properties) {
|
|
15998
|
-
if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
|
|
15999
|
-
return false;
|
|
16000
|
-
}
|
|
16001
|
-
let result = true;
|
|
16002
|
-
e.eachChild(arg => {
|
|
16003
|
-
if (result && !isGlobalPropertyConstant(arg, properties)) {
|
|
16004
|
-
result = false;
|
|
16005
|
-
}
|
|
16006
|
-
});
|
|
16007
|
-
return result;
|
|
16008
|
-
}
|
|
16009
|
-
|
|
16010
16090
|
class Var {
|
|
16011
16091
|
constructor(name, boundExpression) {
|
|
16012
16092
|
this.type = boundExpression.type;
|
|
@@ -16174,7 +16254,6 @@ class ParsingContext {
|
|
|
16174
16254
|
return error;
|
|
16175
16255
|
}
|
|
16176
16256
|
}
|
|
16177
|
-
var ParsingContext$1 = ParsingContext;
|
|
16178
16257
|
function isConstant(expression) {
|
|
16179
16258
|
if (expression instanceof Var) {
|
|
16180
16259
|
return isConstant(expression.boundExpression);
|
|
@@ -16204,6 +16283,7 @@ function isConstant(expression) {
|
|
|
16204
16283
|
return isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [
|
|
16205
16284
|
'zoom',
|
|
16206
16285
|
'heatmap-density',
|
|
16286
|
+
'worldview',
|
|
16207
16287
|
'line-progress',
|
|
16208
16288
|
'raster-value',
|
|
16209
16289
|
'sky-radial-progress',
|
|
@@ -17097,7 +17177,7 @@ class Match {
|
|
|
17097
17177
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17098
17178
|
evaluate(ctx) {
|
|
17099
17179
|
const input = this.input.evaluate(ctx);
|
|
17100
|
-
const output = typeOf(input)
|
|
17180
|
+
const output = typeEquals(typeOf(input), this.inputType) && this.outputs[this.cases[input]] || this.otherwise;
|
|
17101
17181
|
return output.evaluate(ctx);
|
|
17102
17182
|
}
|
|
17103
17183
|
eachChild(fn) {
|
|
@@ -17620,7 +17700,7 @@ function rgba(ctx, [r, g, b, a]) {
|
|
|
17620
17700
|
const error = validateRGBA(r, g, b, alpha);
|
|
17621
17701
|
if (error)
|
|
17622
17702
|
throw new RuntimeError(error);
|
|
17623
|
-
return new Color(r / 255
|
|
17703
|
+
return new Color(r / 255, g / 255, b / 255, alpha);
|
|
17624
17704
|
}
|
|
17625
17705
|
function hsla(ctx, [h, s, l, a]) {
|
|
17626
17706
|
h = h.evaluate(ctx);
|
|
@@ -17687,14 +17767,14 @@ CompoundExpression.register(expressions, {
|
|
|
17687
17767
|
array$1(NumberType, 4),
|
|
17688
17768
|
[ColorType],
|
|
17689
17769
|
(ctx, [v]) => {
|
|
17690
|
-
return v.evaluate(ctx).
|
|
17770
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toArray();
|
|
17691
17771
|
}
|
|
17692
17772
|
],
|
|
17693
17773
|
'to-hsla': [
|
|
17694
17774
|
array$1(NumberType, 4),
|
|
17695
17775
|
[ColorType],
|
|
17696
17776
|
(ctx, [v]) => {
|
|
17697
|
-
return v.evaluate(ctx).
|
|
17777
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toHslaArray();
|
|
17698
17778
|
}
|
|
17699
17779
|
],
|
|
17700
17780
|
'rgb': [
|
|
@@ -17785,6 +17865,11 @@ CompoundExpression.register(expressions, {
|
|
|
17785
17865
|
[],
|
|
17786
17866
|
ctx => ctx.geometryType()
|
|
17787
17867
|
],
|
|
17868
|
+
'worldview': [
|
|
17869
|
+
StringType,
|
|
17870
|
+
[],
|
|
17871
|
+
ctx => ctx.globals.worldview || ''
|
|
17872
|
+
],
|
|
17788
17873
|
'id': [
|
|
17789
17874
|
ValueType,
|
|
17790
17875
|
[],
|
|
@@ -18545,7 +18630,7 @@ function isExpression(expression) {
|
|
|
18545
18630
|
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === 'string' && expression[0] in expressions;
|
|
18546
18631
|
}
|
|
18547
18632
|
function createExpression(expression, propertySpec, scope, options) {
|
|
18548
|
-
const parser = new ParsingContext
|
|
18633
|
+
const parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0, void 0, void 0, scope, options);
|
|
18549
18634
|
const parsed = parser.parse(expression, void 0, void 0, void 0, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : void 0);
|
|
18550
18635
|
if (!parsed) {
|
|
18551
18636
|
return error(parser.errors);
|
|
@@ -20089,7 +20174,10 @@ function diffImports(before = [], after = [], commands) {
|
|
|
20089
20174
|
}
|
|
20090
20175
|
for (const afterImport of after) {
|
|
20091
20176
|
const beforeImport = beforeIndex[afterImport.id];
|
|
20092
|
-
if (!beforeImport
|
|
20177
|
+
if (!beforeImport)
|
|
20178
|
+
continue;
|
|
20179
|
+
delete beforeImport.data;
|
|
20180
|
+
if (deepEqual(beforeImport, afterImport))
|
|
20093
20181
|
continue;
|
|
20094
20182
|
commands.push({
|
|
20095
20183
|
command: operations.updateImport,
|
|
@@ -20574,7 +20662,6 @@ function validateFunction(options) {
|
|
|
20574
20662
|
errors2 = errors2.concat(validateStopDomainValue({
|
|
20575
20663
|
key: `${ key }[0]`,
|
|
20576
20664
|
value: value[0],
|
|
20577
|
-
valueSpec: {},
|
|
20578
20665
|
style: options2.style,
|
|
20579
20666
|
styleSpec: options2.styleSpec
|
|
20580
20667
|
}, value));
|
|
@@ -21169,10 +21256,7 @@ function validateSource(options) {
|
|
|
21169
21256
|
return validateEnum({
|
|
21170
21257
|
key: `${ key }.type`,
|
|
21171
21258
|
value: value.type,
|
|
21172
|
-
valueSpec: { values: getSourceTypeValues(styleSpec) }
|
|
21173
|
-
style,
|
|
21174
|
-
styleSpec
|
|
21175
|
-
});
|
|
21259
|
+
valueSpec: { values: getSourceTypeValues(styleSpec) }});
|
|
21176
21260
|
}
|
|
21177
21261
|
}
|
|
21178
21262
|
function getSourceTypeValues(styleSpec) {
|
|
@@ -21351,7 +21435,25 @@ function validateLights(options) {
|
|
|
21351
21435
|
return errors;
|
|
21352
21436
|
}
|
|
21353
21437
|
for (const propertyKey in properties) {
|
|
21354
|
-
|
|
21438
|
+
const transitionMatch = propertyKey.match(/^(.*)-transition$/);
|
|
21439
|
+
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
21440
|
+
if (useThemeMatch && lightPropertySpec[useThemeMatch[1]]) {
|
|
21441
|
+
errors = errors.concat(validate({
|
|
21442
|
+
key: key2,
|
|
21443
|
+
value: properties[propertyKey],
|
|
21444
|
+
valueSpec: { type: 'string' },
|
|
21445
|
+
style,
|
|
21446
|
+
styleSpec
|
|
21447
|
+
}));
|
|
21448
|
+
} else if (transitionMatch && lightPropertySpec[transitionMatch[1]] && lightPropertySpec[transitionMatch[1]].transition) {
|
|
21449
|
+
errors = errors.concat(validate({
|
|
21450
|
+
key: key2,
|
|
21451
|
+
value: light[key2],
|
|
21452
|
+
valueSpec: styleSpec.transition,
|
|
21453
|
+
style,
|
|
21454
|
+
styleSpec
|
|
21455
|
+
}));
|
|
21456
|
+
} else if (!lightPropertySpec[propertyKey]) {
|
|
21355
21457
|
errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${ propertyKey }"`)]);
|
|
21356
21458
|
} else {
|
|
21357
21459
|
errors = errors.concat(validate({
|
|
@@ -21364,25 +21466,7 @@ function validateLights(options) {
|
|
|
21364
21466
|
}
|
|
21365
21467
|
}
|
|
21366
21468
|
} else {
|
|
21367
|
-
|
|
21368
|
-
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
21369
|
-
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
21370
|
-
errors = errors.concat(validate({
|
|
21371
|
-
key: key2,
|
|
21372
|
-
value: light[key2],
|
|
21373
|
-
valueSpec: { type: 'string' },
|
|
21374
|
-
style,
|
|
21375
|
-
styleSpec
|
|
21376
|
-
}));
|
|
21377
|
-
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
21378
|
-
errors = errors.concat(validate({
|
|
21379
|
-
key: key2,
|
|
21380
|
-
value: light[key2],
|
|
21381
|
-
valueSpec: styleSpec.transition,
|
|
21382
|
-
style,
|
|
21383
|
-
styleSpec
|
|
21384
|
-
}));
|
|
21385
|
-
} else if (lightSpec[key2]) {
|
|
21469
|
+
if (lightSpec[key2]) {
|
|
21386
21470
|
errors = errors.concat(validate({
|
|
21387
21471
|
key: key2,
|
|
21388
21472
|
value: light[key2],
|