@mapbox/mapbox-gl-style-spec 14.12.0-beta.1 → 14.13.0-beta.1
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/composite.ts +2 -0
- package/deref.ts +5 -5
- package/diff.ts +21 -21
- package/dist/index.cjs +455 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +64 -30
- package/dist/index.es.js +455 -241
- package/dist/index.es.js.map +1 -1
- package/error/validation_error.ts +1 -3
- package/expression/definitions/assertion.ts +2 -1
- package/expression/definitions/at.ts +1 -1
- package/expression/definitions/at_interpolated.ts +1 -1
- package/expression/definitions/case.ts +3 -1
- package/expression/definitions/coalesce.ts +1 -0
- package/expression/definitions/coercion.ts +3 -1
- package/expression/definitions/collator.ts +2 -1
- package/expression/definitions/comparison.ts +15 -1
- package/expression/definitions/config.ts +33 -10
- package/expression/definitions/distance.ts +6 -4
- package/expression/definitions/format.ts +3 -2
- package/expression/definitions/index.ts +29 -3
- package/expression/definitions/index_of.ts +1 -0
- package/expression/definitions/interpolate.ts +5 -1
- package/expression/definitions/let.ts +1 -0
- package/expression/definitions/literal.ts +3 -3
- package/expression/definitions/match.ts +5 -3
- package/expression/definitions/number_format.ts +3 -4
- package/expression/definitions/slice.ts +1 -0
- package/expression/definitions/step.ts +1 -0
- package/expression/definitions/var.ts +1 -0
- package/expression/definitions/within.ts +6 -2
- package/expression/expression.ts +3 -0
- package/expression/index.ts +18 -3
- package/expression/is_constant.ts +4 -0
- package/expression/parsing_context.ts +1 -1
- package/expression/types/formatted.ts +1 -1
- package/expression/types/image_variant.ts +2 -2
- package/expression/types.ts +9 -0
- package/expression/values.ts +1 -3
- package/feature_filter/convert.ts +13 -6
- package/feature_filter/index.ts +16 -0
- package/format.ts +1 -0
- package/function/convert.ts +5 -1
- package/function/index.ts +28 -0
- package/group_by_layout.ts +17 -8
- package/migrate/expressions.ts +2 -2
- package/migrate/v8.ts +9 -0
- package/migrate/v9.ts +1 -0
- package/migrate.ts +1 -0
- package/package.json +1 -1
- package/read_style.ts +1 -0
- package/reference/latest.ts +1 -0
- package/reference/v8.json +209 -21
- package/types.ts +21 -2
- package/union-to-intersection.ts +1 -1
- package/util/color.ts +85 -69
- package/util/extend.ts +1 -0
- package/util/geometry_util.ts +7 -8
- package/util/interpolate.ts +0 -4
- package/validate/validate.ts +6 -0
- package/validate/validate_array.ts +2 -0
- package/validate/validate_enum.ts +1 -0
- package/validate/validate_expression.ts +4 -0
- package/validate/validate_filter.ts +4 -2
- package/validate/validate_fog.ts +3 -0
- package/validate/validate_function.ts +7 -2
- package/validate/validate_iconset.ts +1 -0
- package/validate/validate_layer.ts +1 -0
- package/validate/validate_light.ts +3 -0
- package/validate/validate_lights.ts +27 -21
- package/validate/validate_model.ts +4 -0
- package/validate/validate_object.ts +2 -2
- package/validate/validate_projection.ts +1 -0
- package/validate/validate_property.ts +4 -0
- package/validate/validate_rain.ts +3 -0
- package/validate/validate_snow.ts +3 -0
- package/validate/validate_source.ts +8 -6
- package/validate/validate_terrain.ts +4 -0
- package/validate_mapbox_api_supported.ts +30 -19
- package/validate_style.ts +1 -0
- package/visit.ts +3 -1
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": {
|
|
@@ -794,6 +797,17 @@
|
|
|
794
797
|
],
|
|
795
798
|
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]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
796
799
|
},
|
|
800
|
+
extra_bounds: {
|
|
801
|
+
type: "array",
|
|
802
|
+
value: {
|
|
803
|
+
type: "array",
|
|
804
|
+
value: "number",
|
|
805
|
+
length: 4,
|
|
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]`."
|
|
807
|
+
},
|
|
808
|
+
experimental: true,
|
|
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."
|
|
810
|
+
},
|
|
797
811
|
scheme: {
|
|
798
812
|
type: "enum",
|
|
799
813
|
values: {
|
|
@@ -873,6 +887,17 @@
|
|
|
873
887
|
],
|
|
874
888
|
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]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
875
889
|
},
|
|
890
|
+
extra_bounds: {
|
|
891
|
+
type: "array",
|
|
892
|
+
value: {
|
|
893
|
+
type: "array",
|
|
894
|
+
value: "number",
|
|
895
|
+
length: 4,
|
|
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]`."
|
|
897
|
+
},
|
|
898
|
+
experimental: true,
|
|
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."
|
|
900
|
+
},
|
|
876
901
|
minzoom: {
|
|
877
902
|
type: "number",
|
|
878
903
|
"default": 0,
|
|
@@ -954,6 +979,17 @@
|
|
|
954
979
|
],
|
|
955
980
|
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]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
956
981
|
},
|
|
982
|
+
extra_bounds: {
|
|
983
|
+
type: "array",
|
|
984
|
+
value: {
|
|
985
|
+
type: "array",
|
|
986
|
+
value: "number",
|
|
987
|
+
length: 4,
|
|
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]`."
|
|
989
|
+
},
|
|
990
|
+
experimental: true,
|
|
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."
|
|
992
|
+
},
|
|
957
993
|
minzoom: {
|
|
958
994
|
type: "number",
|
|
959
995
|
"default": 0,
|
|
@@ -1036,6 +1072,17 @@
|
|
|
1036
1072
|
],
|
|
1037
1073
|
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]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
1038
1074
|
},
|
|
1075
|
+
extra_bounds: {
|
|
1076
|
+
type: "array",
|
|
1077
|
+
value: {
|
|
1078
|
+
type: "array",
|
|
1079
|
+
value: "number",
|
|
1080
|
+
length: 4,
|
|
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]`."
|
|
1082
|
+
},
|
|
1083
|
+
experimental: true,
|
|
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."
|
|
1085
|
+
},
|
|
1039
1086
|
minzoom: {
|
|
1040
1087
|
type: "number",
|
|
1041
1088
|
"default": 0,
|
|
@@ -1745,11 +1792,13 @@
|
|
|
1745
1792
|
"sdk-support": {
|
|
1746
1793
|
"basic functionality": {
|
|
1747
1794
|
android: "11.11.0",
|
|
1748
|
-
ios: "11.11.0"
|
|
1795
|
+
ios: "11.11.0",
|
|
1796
|
+
js: "3.14.0"
|
|
1749
1797
|
},
|
|
1750
1798
|
"data-driven styling": {
|
|
1751
1799
|
android: "11.11.0",
|
|
1752
|
-
ios: "11.11.0"
|
|
1800
|
+
ios: "11.11.0",
|
|
1801
|
+
js: "3.14.0"
|
|
1753
1802
|
}
|
|
1754
1803
|
},
|
|
1755
1804
|
expression: {
|
|
@@ -1804,7 +1853,8 @@
|
|
|
1804
1853
|
"sdk-support": {
|
|
1805
1854
|
"basic functionality": {
|
|
1806
1855
|
android: "11.11.0",
|
|
1807
|
-
ios: "11.11.0"
|
|
1856
|
+
ios: "11.11.0",
|
|
1857
|
+
js: "3.14.0"
|
|
1808
1858
|
}
|
|
1809
1859
|
},
|
|
1810
1860
|
expression: {
|
|
@@ -4543,6 +4593,18 @@
|
|
|
4543
4593
|
}
|
|
4544
4594
|
}
|
|
4545
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
|
+
},
|
|
4546
4608
|
id: {
|
|
4547
4609
|
doc: "Returns the feature's id, if it has one.",
|
|
4548
4610
|
group: "Feature data",
|
|
@@ -5171,6 +5233,7 @@
|
|
|
5171
5233
|
],
|
|
5172
5234
|
relaxZoomRestriction: true
|
|
5173
5235
|
},
|
|
5236
|
+
"use-theme": true,
|
|
5174
5237
|
transition: true,
|
|
5175
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.",
|
|
5176
5239
|
"sdk-support": {
|
|
@@ -5193,6 +5256,7 @@
|
|
|
5193
5256
|
],
|
|
5194
5257
|
relaxZoomRestriction: true
|
|
5195
5258
|
},
|
|
5259
|
+
"use-theme": true,
|
|
5196
5260
|
transition: true,
|
|
5197
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.",
|
|
5198
5262
|
"sdk-support": {
|
|
@@ -5227,6 +5291,7 @@
|
|
|
5227
5291
|
],
|
|
5228
5292
|
relaxZoomRestriction: true
|
|
5229
5293
|
},
|
|
5294
|
+
"use-theme": true,
|
|
5230
5295
|
transition: true,
|
|
5231
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.",
|
|
5232
5297
|
"sdk-support": {
|
|
@@ -5414,6 +5479,7 @@
|
|
|
5414
5479
|
],
|
|
5415
5480
|
relaxZoomRestriction: true
|
|
5416
5481
|
},
|
|
5482
|
+
"use-theme": true,
|
|
5417
5483
|
transition: true,
|
|
5418
5484
|
doc: "Snow particles color.",
|
|
5419
5485
|
"sdk-support": {
|
|
@@ -5499,6 +5565,7 @@
|
|
|
5499
5565
|
],
|
|
5500
5566
|
relaxZoomRestriction: true
|
|
5501
5567
|
},
|
|
5568
|
+
"use-theme": true,
|
|
5502
5569
|
transition: true,
|
|
5503
5570
|
doc: "Snow vignette screen-space corners tint color.",
|
|
5504
5571
|
"sdk-support": {
|
|
@@ -5683,6 +5750,7 @@
|
|
|
5683
5750
|
],
|
|
5684
5751
|
relaxZoomRestriction: true
|
|
5685
5752
|
},
|
|
5753
|
+
"use-theme": true,
|
|
5686
5754
|
transition: true,
|
|
5687
5755
|
doc: "Individual rain particle dorplets color.",
|
|
5688
5756
|
"sdk-support": {
|
|
@@ -5794,6 +5862,7 @@
|
|
|
5794
5862
|
],
|
|
5795
5863
|
relaxZoomRestriction: true
|
|
5796
5864
|
},
|
|
5865
|
+
"use-theme": true,
|
|
5797
5866
|
transition: true,
|
|
5798
5867
|
doc: "Rain vignette screen-space corners tint color.",
|
|
5799
5868
|
"sdk-support": {
|
|
@@ -6057,6 +6126,7 @@
|
|
|
6057
6126
|
"zoom"
|
|
6058
6127
|
]
|
|
6059
6128
|
},
|
|
6129
|
+
"use-theme": true,
|
|
6060
6130
|
transition: true,
|
|
6061
6131
|
doc: "Color tint for lighting extruded geometries.",
|
|
6062
6132
|
"sdk-support": {
|
|
@@ -6305,6 +6375,7 @@
|
|
|
6305
6375
|
type: "color",
|
|
6306
6376
|
"default": "#000000",
|
|
6307
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,
|
|
6308
6379
|
transition: true,
|
|
6309
6380
|
requires: [
|
|
6310
6381
|
{
|
|
@@ -6337,6 +6408,7 @@
|
|
|
6337
6408
|
"fill-outline-color": {
|
|
6338
6409
|
type: "color",
|
|
6339
6410
|
doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
|
|
6411
|
+
"use-theme": true,
|
|
6340
6412
|
transition: true,
|
|
6341
6413
|
requires: [
|
|
6342
6414
|
{
|
|
@@ -6450,6 +6522,31 @@
|
|
|
6450
6522
|
},
|
|
6451
6523
|
"property-type": "data-driven"
|
|
6452
6524
|
},
|
|
6525
|
+
"fill-pattern-cross-fade": {
|
|
6526
|
+
type: "number",
|
|
6527
|
+
"property-type": "data-constant",
|
|
6528
|
+
"default": 0,
|
|
6529
|
+
minimum: 0,
|
|
6530
|
+
maximum: 1,
|
|
6531
|
+
expression: {
|
|
6532
|
+
interpolated: true,
|
|
6533
|
+
parameters: [
|
|
6534
|
+
"zoom",
|
|
6535
|
+
"measure-light"
|
|
6536
|
+
]
|
|
6537
|
+
},
|
|
6538
|
+
requires: [
|
|
6539
|
+
"line-pattern"
|
|
6540
|
+
],
|
|
6541
|
+
"sdk-support": {
|
|
6542
|
+
"basic functionality": {
|
|
6543
|
+
js: "3.12.0",
|
|
6544
|
+
android: "11.14.0",
|
|
6545
|
+
ios: "11.14.0"
|
|
6546
|
+
}
|
|
6547
|
+
},
|
|
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)."
|
|
6549
|
+
},
|
|
6453
6550
|
"fill-emissive-strength": {
|
|
6454
6551
|
type: "number",
|
|
6455
6552
|
"default": 0,
|
|
@@ -6506,15 +6603,18 @@
|
|
|
6506
6603
|
doc: "The color of bridge guard rail.",
|
|
6507
6604
|
experimental: true,
|
|
6508
6605
|
"private": true,
|
|
6606
|
+
"use-theme": true,
|
|
6509
6607
|
transition: true,
|
|
6510
6608
|
"sdk-support": {
|
|
6511
6609
|
"basic functionality": {
|
|
6512
6610
|
android: "11.11.0",
|
|
6513
|
-
ios: "11.11.0"
|
|
6611
|
+
ios: "11.11.0",
|
|
6612
|
+
js: "3.14.0"
|
|
6514
6613
|
},
|
|
6515
6614
|
"data-driven styling": {
|
|
6516
6615
|
android: "11.11.0",
|
|
6517
|
-
ios: "11.11.0"
|
|
6616
|
+
ios: "11.11.0",
|
|
6617
|
+
js: "3.14.0"
|
|
6518
6618
|
}
|
|
6519
6619
|
},
|
|
6520
6620
|
expression: {
|
|
@@ -6531,17 +6631,20 @@
|
|
|
6531
6631
|
type: "color",
|
|
6532
6632
|
"default": "rgba(241, 236, 225, 255)",
|
|
6533
6633
|
doc: "The color of tunnel structures (tunnel entrance and tunnel walls).",
|
|
6634
|
+
"use-theme": true,
|
|
6534
6635
|
transition: true,
|
|
6535
6636
|
experimental: true,
|
|
6536
6637
|
"private": true,
|
|
6537
6638
|
"sdk-support": {
|
|
6538
6639
|
"basic functionality": {
|
|
6539
6640
|
android: "11.11.0",
|
|
6540
|
-
ios: "11.11.0"
|
|
6641
|
+
ios: "11.11.0",
|
|
6642
|
+
js: "3.14.0"
|
|
6541
6643
|
},
|
|
6542
6644
|
"data-driven styling": {
|
|
6543
6645
|
android: "11.11.0",
|
|
6544
|
-
ios: "11.11.0"
|
|
6646
|
+
ios: "11.11.0",
|
|
6647
|
+
js: "3.14.0"
|
|
6545
6648
|
}
|
|
6546
6649
|
},
|
|
6547
6650
|
expression: {
|
|
@@ -6699,6 +6802,8 @@
|
|
|
6699
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`.",
|
|
6700
6803
|
experimental: true,
|
|
6701
6804
|
"private": true,
|
|
6805
|
+
"use-theme": true,
|
|
6806
|
+
transition: false,
|
|
6702
6807
|
"sdk-support": {
|
|
6703
6808
|
"basic functionality": {
|
|
6704
6809
|
},
|
|
@@ -6773,6 +6878,7 @@
|
|
|
6773
6878
|
type: "color",
|
|
6774
6879
|
doc: "The color with which the line will be drawn.",
|
|
6775
6880
|
"default": "#000000",
|
|
6881
|
+
"use-theme": true,
|
|
6776
6882
|
transition: true,
|
|
6777
6883
|
requires: [
|
|
6778
6884
|
{
|
|
@@ -7034,6 +7140,31 @@
|
|
|
7034
7140
|
},
|
|
7035
7141
|
"property-type": "data-driven"
|
|
7036
7142
|
},
|
|
7143
|
+
"line-pattern-cross-fade": {
|
|
7144
|
+
type: "number",
|
|
7145
|
+
"property-type": "data-constant",
|
|
7146
|
+
"default": 0,
|
|
7147
|
+
minimum: 0,
|
|
7148
|
+
maximum: 1,
|
|
7149
|
+
expression: {
|
|
7150
|
+
interpolated: true,
|
|
7151
|
+
parameters: [
|
|
7152
|
+
"zoom",
|
|
7153
|
+
"measure-light"
|
|
7154
|
+
]
|
|
7155
|
+
},
|
|
7156
|
+
requires: [
|
|
7157
|
+
"line-pattern"
|
|
7158
|
+
],
|
|
7159
|
+
"sdk-support": {
|
|
7160
|
+
"basic functionality": {
|
|
7161
|
+
js: "3.12.0",
|
|
7162
|
+
android: "11.14.0",
|
|
7163
|
+
ios: "11.14.0"
|
|
7164
|
+
}
|
|
7165
|
+
},
|
|
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)."
|
|
7167
|
+
},
|
|
7037
7168
|
"line-gradient": {
|
|
7038
7169
|
type: "color",
|
|
7039
7170
|
doc: "A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
|
|
@@ -7058,6 +7189,7 @@
|
|
|
7058
7189
|
1,
|
|
7059
7190
|
"red"
|
|
7060
7191
|
],
|
|
7192
|
+
"use-theme": true,
|
|
7061
7193
|
transition: false,
|
|
7062
7194
|
requires: [
|
|
7063
7195
|
{
|
|
@@ -7171,6 +7303,7 @@
|
|
|
7171
7303
|
doc: "The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.",
|
|
7172
7304
|
experimental: true,
|
|
7173
7305
|
"default": "transparent",
|
|
7306
|
+
"use-theme": true,
|
|
7174
7307
|
transition: true,
|
|
7175
7308
|
requires: [
|
|
7176
7309
|
"line-trim-offset",
|
|
@@ -7257,6 +7390,7 @@
|
|
|
7257
7390
|
"private": true,
|
|
7258
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.",
|
|
7259
7392
|
"default": "rgba(0, 0, 0, 0)",
|
|
7393
|
+
"use-theme": true,
|
|
7260
7394
|
transition: true,
|
|
7261
7395
|
"sdk-support": {
|
|
7262
7396
|
"basic functionality": {
|
|
@@ -7338,6 +7472,7 @@
|
|
|
7338
7472
|
type: "color",
|
|
7339
7473
|
"default": "#000000",
|
|
7340
7474
|
doc: "The fill color of the circle.",
|
|
7475
|
+
"use-theme": true,
|
|
7341
7476
|
transition: true,
|
|
7342
7477
|
"sdk-support": {
|
|
7343
7478
|
"basic functionality": {
|
|
@@ -7564,6 +7699,7 @@
|
|
|
7564
7699
|
type: "color",
|
|
7565
7700
|
"default": "#000000",
|
|
7566
7701
|
doc: "The stroke color of the circle.",
|
|
7702
|
+
"use-theme": true,
|
|
7567
7703
|
transition: true,
|
|
7568
7704
|
"sdk-support": {
|
|
7569
7705
|
"basic functionality": {
|
|
@@ -7750,6 +7886,7 @@
|
|
|
7750
7886
|
"red"
|
|
7751
7887
|
],
|
|
7752
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,
|
|
7753
7890
|
transition: false,
|
|
7754
7891
|
"sdk-support": {
|
|
7755
7892
|
"basic functionality": {
|
|
@@ -7925,6 +8062,7 @@
|
|
|
7925
8062
|
"icon-color": {
|
|
7926
8063
|
type: "color",
|
|
7927
8064
|
"default": "#000000",
|
|
8065
|
+
"use-theme": true,
|
|
7928
8066
|
transition: true,
|
|
7929
8067
|
doc: "The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",
|
|
7930
8068
|
requires: [
|
|
@@ -7956,6 +8094,7 @@
|
|
|
7956
8094
|
"icon-halo-color": {
|
|
7957
8095
|
type: "color",
|
|
7958
8096
|
"default": "rgba(0, 0, 0, 0)",
|
|
8097
|
+
"use-theme": true,
|
|
7959
8098
|
transition: true,
|
|
7960
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/).",
|
|
7961
8100
|
requires: [
|
|
@@ -8112,7 +8251,7 @@
|
|
|
8112
8251
|
},
|
|
8113
8252
|
"icon-image-cross-fade": {
|
|
8114
8253
|
type: "number",
|
|
8115
|
-
"property-type": "data-
|
|
8254
|
+
"property-type": "data-constant",
|
|
8116
8255
|
"default": 0,
|
|
8117
8256
|
minimum: 0,
|
|
8118
8257
|
maximum: 1,
|
|
@@ -8120,8 +8259,6 @@
|
|
|
8120
8259
|
interpolated: true,
|
|
8121
8260
|
parameters: [
|
|
8122
8261
|
"zoom",
|
|
8123
|
-
"feature",
|
|
8124
|
-
"feature-state",
|
|
8125
8262
|
"measure-light"
|
|
8126
8263
|
]
|
|
8127
8264
|
},
|
|
@@ -8133,15 +8270,9 @@
|
|
|
8133
8270
|
js: "3.0.0",
|
|
8134
8271
|
android: "11.0.0",
|
|
8135
8272
|
ios: "11.0.0"
|
|
8136
|
-
},
|
|
8137
|
-
"data-driven styling": {
|
|
8138
|
-
js: "3.0.0",
|
|
8139
|
-
android: "11.0.0",
|
|
8140
|
-
ios: "11.0.0"
|
|
8141
8273
|
}
|
|
8142
8274
|
},
|
|
8143
|
-
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."
|
|
8144
|
-
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)."
|
|
8145
8276
|
},
|
|
8146
8277
|
"text-opacity": {
|
|
8147
8278
|
type: "number",
|
|
@@ -8213,6 +8344,7 @@
|
|
|
8213
8344
|
type: "color",
|
|
8214
8345
|
doc: "The color with which the text will be drawn.",
|
|
8215
8346
|
"default": "#000000",
|
|
8347
|
+
"use-theme": true,
|
|
8216
8348
|
transition: true,
|
|
8217
8349
|
overridable: true,
|
|
8218
8350
|
requires: [
|
|
@@ -8244,6 +8376,7 @@
|
|
|
8244
8376
|
"text-halo-color": {
|
|
8245
8377
|
type: "color",
|
|
8246
8378
|
"default": "rgba(0, 0, 0, 0)",
|
|
8379
|
+
"use-theme": true,
|
|
8247
8380
|
transition: true,
|
|
8248
8381
|
doc: "The color of the text's halo, which helps it stand out from backgrounds.",
|
|
8249
8382
|
requires: [
|
|
@@ -8529,6 +8662,7 @@
|
|
|
8529
8662
|
"raster-color": {
|
|
8530
8663
|
type: "color",
|
|
8531
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,
|
|
8532
8666
|
transition: false,
|
|
8533
8667
|
"sdk-support": {
|
|
8534
8668
|
"basic functionality": {
|
|
@@ -8916,6 +9050,7 @@
|
|
|
8916
9050
|
type: "color",
|
|
8917
9051
|
"default": "#000000",
|
|
8918
9052
|
doc: "The shading color of areas that face away from the light source.",
|
|
9053
|
+
"use-theme": true,
|
|
8919
9054
|
transition: true,
|
|
8920
9055
|
"sdk-support": {
|
|
8921
9056
|
"basic functionality": {
|
|
@@ -8937,6 +9072,7 @@
|
|
|
8937
9072
|
type: "color",
|
|
8938
9073
|
"default": "#FFFFFF",
|
|
8939
9074
|
doc: "The shading color of areas that faces towards the light source.",
|
|
9075
|
+
"use-theme": true,
|
|
8940
9076
|
transition: true,
|
|
8941
9077
|
"sdk-support": {
|
|
8942
9078
|
"basic functionality": {
|
|
@@ -8958,6 +9094,7 @@
|
|
|
8958
9094
|
type: "color",
|
|
8959
9095
|
"default": "#000000",
|
|
8960
9096
|
doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
|
|
9097
|
+
"use-theme": true,
|
|
8961
9098
|
transition: true,
|
|
8962
9099
|
"sdk-support": {
|
|
8963
9100
|
"basic functionality": {
|
|
@@ -9034,6 +9171,7 @@
|
|
|
9034
9171
|
type: "color",
|
|
9035
9172
|
"default": "#000000",
|
|
9036
9173
|
doc: "The color with which the background will be drawn.",
|
|
9174
|
+
"use-theme": true,
|
|
9037
9175
|
transition: true,
|
|
9038
9176
|
requires: [
|
|
9039
9177
|
{
|
|
@@ -9289,6 +9427,7 @@
|
|
|
9289
9427
|
"white"
|
|
9290
9428
|
],
|
|
9291
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,
|
|
9292
9431
|
transition: false,
|
|
9293
9432
|
requires: [
|
|
9294
9433
|
{
|
|
@@ -9316,6 +9455,7 @@
|
|
|
9316
9455
|
type: "color",
|
|
9317
9456
|
"default": "white",
|
|
9318
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,
|
|
9319
9459
|
transition: false,
|
|
9320
9460
|
requires: [
|
|
9321
9461
|
{
|
|
@@ -9335,6 +9475,7 @@
|
|
|
9335
9475
|
type: "color",
|
|
9336
9476
|
"default": "white",
|
|
9337
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,
|
|
9338
9479
|
transition: false,
|
|
9339
9480
|
requires: [
|
|
9340
9481
|
{
|
|
@@ -9530,6 +9671,7 @@
|
|
|
9530
9671
|
ios: "11.0.0"
|
|
9531
9672
|
}
|
|
9532
9673
|
},
|
|
9674
|
+
"use-theme": true,
|
|
9533
9675
|
transition: true
|
|
9534
9676
|
},
|
|
9535
9677
|
"model-color-mix-intensity": {
|
|
@@ -9802,6 +9944,25 @@
|
|
|
9802
9944
|
doc: "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state."
|
|
9803
9945
|
}
|
|
9804
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
|
+
};
|
|
9805
9966
|
var v8 = {
|
|
9806
9967
|
$version: $version,
|
|
9807
9968
|
$root: $root,
|
|
@@ -10148,6 +10309,7 @@
|
|
|
10148
10309
|
type: "color",
|
|
10149
10310
|
"default": "#000000",
|
|
10150
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,
|
|
10151
10313
|
transition: true,
|
|
10152
10314
|
requires: [
|
|
10153
10315
|
{
|
|
@@ -10258,6 +10420,31 @@
|
|
|
10258
10420
|
},
|
|
10259
10421
|
"property-type": "data-driven"
|
|
10260
10422
|
},
|
|
10423
|
+
"fill-extrusion-pattern-cross-fade": {
|
|
10424
|
+
type: "number",
|
|
10425
|
+
"property-type": "data-constant",
|
|
10426
|
+
"default": 0,
|
|
10427
|
+
minimum: 0,
|
|
10428
|
+
maximum: 1,
|
|
10429
|
+
expression: {
|
|
10430
|
+
interpolated: true,
|
|
10431
|
+
parameters: [
|
|
10432
|
+
"zoom",
|
|
10433
|
+
"measure-light"
|
|
10434
|
+
]
|
|
10435
|
+
},
|
|
10436
|
+
requires: [
|
|
10437
|
+
"line-pattern"
|
|
10438
|
+
],
|
|
10439
|
+
"sdk-support": {
|
|
10440
|
+
"basic functionality": {
|
|
10441
|
+
js: "3.12.0",
|
|
10442
|
+
android: "11.14.0",
|
|
10443
|
+
ios: "11.14.0"
|
|
10444
|
+
}
|
|
10445
|
+
},
|
|
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)."
|
|
10447
|
+
},
|
|
10261
10448
|
"fill-extrusion-height": {
|
|
10262
10449
|
type: "number",
|
|
10263
10450
|
"default": 0,
|
|
@@ -10521,6 +10708,7 @@
|
|
|
10521
10708
|
requires: [
|
|
10522
10709
|
"lights"
|
|
10523
10710
|
],
|
|
10711
|
+
"use-theme": true,
|
|
10524
10712
|
transition: true,
|
|
10525
10713
|
expression: {
|
|
10526
10714
|
interpolated: true,
|
|
@@ -10836,6 +11024,7 @@
|
|
|
10836
11024
|
"raster-particle-color": {
|
|
10837
11025
|
type: "color",
|
|
10838
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,
|
|
10839
11028
|
transition: false,
|
|
10840
11029
|
"sdk-support": {
|
|
10841
11030
|
"basic functionality": {
|
|
@@ -10974,7 +11163,8 @@
|
|
|
10974
11163
|
doc: "Property is constant across all zoom levels and property values."
|
|
10975
11164
|
}
|
|
10976
11165
|
},
|
|
10977
|
-
promoteId: promoteId
|
|
11166
|
+
promoteId: promoteId,
|
|
11167
|
+
$doc: $doc
|
|
10978
11168
|
};
|
|
10979
11169
|
|
|
10980
11170
|
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
@@ -11397,6 +11587,13 @@
|
|
|
11397
11587
|
}
|
|
11398
11588
|
});
|
|
11399
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
|
+
}
|
|
11400
11597
|
|
|
11401
11598
|
function getDefaultExportFromCjs (x) {
|
|
11402
11599
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -12467,15 +12664,11 @@
|
|
|
12467
12664
|
return number(d, to[i], t);
|
|
12468
12665
|
});
|
|
12469
12666
|
}
|
|
12470
|
-
function easeIn(x) {
|
|
12471
|
-
return x * x * x * x * x;
|
|
12472
|
-
}
|
|
12473
12667
|
|
|
12474
12668
|
var interpolate$1 = /*#__PURE__*/Object.freeze({
|
|
12475
12669
|
__proto__: null,
|
|
12476
12670
|
array: array,
|
|
12477
12671
|
color: color,
|
|
12478
|
-
easeIn: easeIn,
|
|
12479
12672
|
number: number
|
|
12480
12673
|
});
|
|
12481
12674
|
|
|
@@ -12504,7 +12697,7 @@
|
|
|
12504
12697
|
if (!rgba) {
|
|
12505
12698
|
return void 0;
|
|
12506
12699
|
}
|
|
12507
|
-
return new Color(rgba[0] / 255
|
|
12700
|
+
return new Color(rgba[0] / 255, rgba[1] / 255, rgba[2] / 255, rgba[3]);
|
|
12508
12701
|
}
|
|
12509
12702
|
/**
|
|
12510
12703
|
* Returns an RGBA string representing the color value.
|
|
@@ -12516,20 +12709,6 @@
|
|
|
12516
12709
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
12517
12710
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
12518
12711
|
*/
|
|
12519
|
-
toStringPremultipliedAlpha() {
|
|
12520
|
-
const [r, g, b, a] = this.a === 0 ? [
|
|
12521
|
-
0,
|
|
12522
|
-
0,
|
|
12523
|
-
0,
|
|
12524
|
-
0
|
|
12525
|
-
] : [
|
|
12526
|
-
this.r * 255 / this.a,
|
|
12527
|
-
this.g * 255 / this.a,
|
|
12528
|
-
this.b * 255 / this.a,
|
|
12529
|
-
this.a
|
|
12530
|
-
];
|
|
12531
|
-
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
12532
|
-
}
|
|
12533
12712
|
toString() {
|
|
12534
12713
|
const [r, g, b, a] = [
|
|
12535
12714
|
this.r,
|
|
@@ -12539,16 +12718,22 @@
|
|
|
12539
12718
|
];
|
|
12540
12719
|
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
12541
12720
|
}
|
|
12542
|
-
|
|
12721
|
+
toNonPremultipliedRenderColor(lut) {
|
|
12543
12722
|
const {r, g, b, a} = this;
|
|
12544
|
-
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);
|
|
12545
12728
|
}
|
|
12546
12729
|
clone() {
|
|
12547
12730
|
return new Color(this.r, this.g, this.b, this.a);
|
|
12548
12731
|
}
|
|
12549
12732
|
}
|
|
12550
12733
|
class RenderColor {
|
|
12551
|
-
constructor(lut, r, g, b, a) {
|
|
12734
|
+
constructor(lut, r, g, b, a, premultiplied = false) {
|
|
12735
|
+
this.premultiplied = false;
|
|
12736
|
+
this.premultiplied = premultiplied;
|
|
12552
12737
|
if (!lut) {
|
|
12553
12738
|
this.r = r;
|
|
12554
12739
|
this.g = g;
|
|
@@ -12557,9 +12742,15 @@
|
|
|
12557
12742
|
} else {
|
|
12558
12743
|
const N = lut.image.height;
|
|
12559
12744
|
const N2 = N * N;
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
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
|
+
}
|
|
12563
12754
|
const r0 = Math.floor(r);
|
|
12564
12755
|
const g0 = Math.floor(g);
|
|
12565
12756
|
const b0 = Math.floor(b);
|
|
@@ -12581,49 +12772,46 @@
|
|
|
12581
12772
|
if (i0 < 0 || i7 >= data.length) {
|
|
12582
12773
|
throw new Error('out of range');
|
|
12583
12774
|
}
|
|
12584
|
-
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;
|
|
12585
|
-
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;
|
|
12586
|
-
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);
|
|
12587
12778
|
this.a = a;
|
|
12588
12779
|
}
|
|
12589
12780
|
}
|
|
12590
12781
|
/**
|
|
12591
|
-
* Returns an RGBA array of values representing the color
|
|
12592
|
-
*
|
|
12782
|
+
* Returns an RGBA array of values representing the color.
|
|
12593
12783
|
* @returns An array of RGBA color values in the range [0, 255].
|
|
12594
12784
|
*/
|
|
12595
12785
|
toArray() {
|
|
12596
12786
|
const {r, g, b, a} = this;
|
|
12597
|
-
return
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
0
|
|
12602
|
-
] : [
|
|
12603
|
-
r * 255 / a,
|
|
12604
|
-
g * 255 / a,
|
|
12605
|
-
b * 255 / a,
|
|
12787
|
+
return [
|
|
12788
|
+
r * 255,
|
|
12789
|
+
g * 255,
|
|
12790
|
+
b * 255,
|
|
12606
12791
|
a
|
|
12607
12792
|
];
|
|
12608
12793
|
}
|
|
12609
12794
|
/**
|
|
12610
12795
|
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
12611
|
-
*
|
|
12612
12796
|
* @returns An array of HSLA color values.
|
|
12613
12797
|
*/
|
|
12614
12798
|
toHslaArray() {
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
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;
|
|
12622
12811
|
}
|
|
12623
|
-
const
|
|
12624
|
-
const
|
|
12625
|
-
const
|
|
12626
|
-
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);
|
|
12627
12815
|
const min = Math.min(red, green, blue);
|
|
12628
12816
|
const max = Math.max(red, green, blue);
|
|
12629
12817
|
const l = (min + max) / 2;
|
|
@@ -12654,21 +12842,16 @@
|
|
|
12654
12842
|
];
|
|
12655
12843
|
}
|
|
12656
12844
|
/**
|
|
12657
|
-
* Returns a RGBA array of float values representing the color
|
|
12845
|
+
* Returns a RGBA array of float values representing the color.
|
|
12658
12846
|
*
|
|
12659
12847
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12660
12848
|
*/
|
|
12661
12849
|
toArray01() {
|
|
12662
12850
|
const {r, g, b, a} = this;
|
|
12663
|
-
return
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
0
|
|
12668
|
-
] : [
|
|
12669
|
-
r / a,
|
|
12670
|
-
g / a,
|
|
12671
|
-
b / a,
|
|
12851
|
+
return [
|
|
12852
|
+
r,
|
|
12853
|
+
g,
|
|
12854
|
+
b,
|
|
12672
12855
|
a
|
|
12673
12856
|
];
|
|
12674
12857
|
}
|
|
@@ -12679,52 +12862,39 @@
|
|
|
12679
12862
|
* @returns An array of RGB color values in the range [0, 1].
|
|
12680
12863
|
*/
|
|
12681
12864
|
toArray01Scaled(scale) {
|
|
12682
|
-
const {r, g, b
|
|
12683
|
-
return a === 0 ? [
|
|
12684
|
-
0,
|
|
12685
|
-
0,
|
|
12686
|
-
0
|
|
12687
|
-
] : [
|
|
12688
|
-
r / a * scale,
|
|
12689
|
-
g / a * scale,
|
|
12690
|
-
b / a * scale
|
|
12691
|
-
];
|
|
12692
|
-
}
|
|
12693
|
-
/**
|
|
12694
|
-
* Returns an RGBA array of values representing the color, premultiplied by A.
|
|
12695
|
-
*
|
|
12696
|
-
* @returns An array of RGBA color values in the range [0, 1].
|
|
12697
|
-
*/
|
|
12698
|
-
toArray01PremultipliedAlpha() {
|
|
12699
|
-
const {r, g, b, a} = this;
|
|
12865
|
+
const {r, g, b} = this;
|
|
12700
12866
|
return [
|
|
12701
|
-
r,
|
|
12702
|
-
g,
|
|
12703
|
-
b
|
|
12704
|
-
a
|
|
12867
|
+
r * scale,
|
|
12868
|
+
g * scale,
|
|
12869
|
+
b * scale
|
|
12705
12870
|
];
|
|
12706
12871
|
}
|
|
12707
12872
|
/**
|
|
12708
|
-
* Returns an RGBA array of values representing the color
|
|
12709
|
-
* The color is defined by sRGB primaries, but the sRGB transfer function
|
|
12710
|
-
*
|
|
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.
|
|
12711
12876
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
12712
12877
|
*/
|
|
12713
12878
|
toArray01Linear() {
|
|
12714
12879
|
const {r, g, b, a} = this;
|
|
12715
|
-
return
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
0
|
|
12720
|
-
] : [
|
|
12721
|
-
Math.pow(r / a, 2.2),
|
|
12722
|
-
Math.pow(g / a, 2.2),
|
|
12723
|
-
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),
|
|
12724
12884
|
a
|
|
12725
12885
|
];
|
|
12726
12886
|
}
|
|
12727
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
|
+
}
|
|
12728
12898
|
Color.black = new Color(0, 0, 0, 1);
|
|
12729
12899
|
Color.white = new Color(1, 1, 1, 1);
|
|
12730
12900
|
Color.transparent = new Color(0, 0, 0, 0);
|
|
@@ -12813,7 +12983,7 @@
|
|
|
12813
12983
|
options['font-scale'] = section.scale;
|
|
12814
12984
|
}
|
|
12815
12985
|
if (section.textColor) {
|
|
12816
|
-
options['text-color'] = ['rgba'].concat(section.textColor.
|
|
12986
|
+
options['text-color'] = ['rgba'].concat(section.textColor.toNonPremultipliedRenderColor(null).toArray());
|
|
12817
12987
|
}
|
|
12818
12988
|
serialized.push(options);
|
|
12819
12989
|
}
|
|
@@ -12925,8 +13095,8 @@
|
|
|
12925
13095
|
])
|
|
12926
13096
|
});
|
|
12927
13097
|
}
|
|
12928
|
-
scaleSelf(factor) {
|
|
12929
|
-
this.options.transform.scaleSelf(factor);
|
|
13098
|
+
scaleSelf(factor, yFactor) {
|
|
13099
|
+
this.options.transform.scaleSelf(factor, yFactor);
|
|
12930
13100
|
return this;
|
|
12931
13101
|
}
|
|
12932
13102
|
}
|
|
@@ -13111,9 +13281,7 @@
|
|
|
13111
13281
|
return '';
|
|
13112
13282
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
13113
13283
|
return String(value);
|
|
13114
|
-
} else if (value instanceof Color) {
|
|
13115
|
-
return value.toStringPremultipliedAlpha();
|
|
13116
|
-
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
13284
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage || value instanceof Color) {
|
|
13117
13285
|
return value.toString();
|
|
13118
13286
|
} else {
|
|
13119
13287
|
return JSON.stringify(value);
|
|
@@ -13153,7 +13321,7 @@
|
|
|
13153
13321
|
this.value
|
|
13154
13322
|
];
|
|
13155
13323
|
} else if (this.value instanceof Color) {
|
|
13156
|
-
return ['rgba'].concat(this.value.
|
|
13324
|
+
return ['rgba'].concat(this.value.toNonPremultipliedRenderColor(null).toArray());
|
|
13157
13325
|
} else if (this.value instanceof Formatted) {
|
|
13158
13326
|
return this.value.serialize();
|
|
13159
13327
|
} else {
|
|
@@ -13221,6 +13389,7 @@
|
|
|
13221
13389
|
}
|
|
13222
13390
|
return new Assertion(type, parsed);
|
|
13223
13391
|
}
|
|
13392
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13224
13393
|
evaluate(ctx) {
|
|
13225
13394
|
for (let i = 0; i < this.args.length; i++) {
|
|
13226
13395
|
const value = this.args[i].evaluate(ctx);
|
|
@@ -13318,7 +13487,7 @@
|
|
|
13318
13487
|
evaluate(ctx) {
|
|
13319
13488
|
const evaluateSection = section => {
|
|
13320
13489
|
const evaluatedContent = section.content.evaluate(ctx);
|
|
13321
|
-
if (typeOf(evaluatedContent)
|
|
13490
|
+
if (typeEquals(typeOf(evaluatedContent), ResolvedImageType)) {
|
|
13322
13491
|
return new FormattedSection('', evaluatedContent, null, null, null);
|
|
13323
13492
|
}
|
|
13324
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);
|
|
@@ -13640,6 +13809,7 @@
|
|
|
13640
13809
|
}
|
|
13641
13810
|
return new Coercion(type, parsed);
|
|
13642
13811
|
}
|
|
13812
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13643
13813
|
evaluate(ctx) {
|
|
13644
13814
|
if (this.type.kind === 'boolean') {
|
|
13645
13815
|
return Boolean(this.args[0].evaluate(ctx));
|
|
@@ -13824,7 +13994,7 @@
|
|
|
13824
13994
|
continue;
|
|
13825
13995
|
overloadParams.push(params);
|
|
13826
13996
|
overloadIndex++;
|
|
13827
|
-
signatureContext = new ParsingContext
|
|
13997
|
+
signatureContext = new ParsingContext(context.registry, context.path, null, context.scope, void 0, context._scope, context.options);
|
|
13828
13998
|
const parsedArgs = [];
|
|
13829
13999
|
let argParseFailed = false;
|
|
13830
14000
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15718,6 +15888,89 @@
|
|
|
15718
15888
|
}
|
|
15719
15889
|
}
|
|
15720
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
|
+
}
|
|
15721
15974
|
function coerceValue(type, value) {
|
|
15722
15975
|
switch (type) {
|
|
15723
15976
|
case 'string':
|
|
@@ -15750,10 +16003,11 @@
|
|
|
15750
16003
|
return value;
|
|
15751
16004
|
}
|
|
15752
16005
|
class Config {
|
|
15753
|
-
constructor(type, key, scope) {
|
|
16006
|
+
constructor(type, key, scope, featureConstant = false) {
|
|
15754
16007
|
this.type = type;
|
|
15755
16008
|
this.key = key;
|
|
15756
16009
|
this.scope = scope;
|
|
16010
|
+
this.featureConstant = featureConstant;
|
|
15757
16011
|
}
|
|
15758
16012
|
static parse(args, context) {
|
|
15759
16013
|
let type = context.expectedType;
|
|
@@ -15767,23 +16021,29 @@
|
|
|
15767
16021
|
if (!(configKey instanceof Literal)) {
|
|
15768
16022
|
return context.error(`Key name of 'config' expression must be a string literal.`);
|
|
15769
16023
|
}
|
|
16024
|
+
let featureConstant = true;
|
|
16025
|
+
let configScopeValue;
|
|
16026
|
+
const configKeyValue = toString(configKey.value);
|
|
15770
16027
|
if (args.length >= 3) {
|
|
15771
16028
|
const configScope = context.parse(args[2], 2);
|
|
15772
16029
|
if (!(configScope instanceof Literal)) {
|
|
15773
16030
|
return context.error(`Scope of 'config' expression must be a string literal.`);
|
|
15774
16031
|
}
|
|
15775
|
-
|
|
16032
|
+
configScopeValue = toString(configScope.value);
|
|
16033
|
+
}
|
|
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
|
+
}
|
|
15776
16040
|
}
|
|
15777
|
-
return new Config(type,
|
|
16041
|
+
return new Config(type, configKeyValue, configScopeValue, featureConstant);
|
|
15778
16042
|
}
|
|
16043
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15779
16044
|
evaluate(ctx) {
|
|
15780
|
-
const
|
|
15781
|
-
const
|
|
15782
|
-
this.key,
|
|
15783
|
-
this.scope,
|
|
15784
|
-
ctx.scope
|
|
15785
|
-
].filter(Boolean).join(FQIDSeparator);
|
|
15786
|
-
const config = ctx.getConfig(configKey);
|
|
16045
|
+
const fqid = makeConfigFQID(this.key, this.scope, ctx.scope);
|
|
16046
|
+
const config = ctx.getConfig(fqid);
|
|
15787
16047
|
if (!config)
|
|
15788
16048
|
return null;
|
|
15789
16049
|
const {type, value, values, minValue, maxValue, stepValue} = config;
|
|
@@ -15811,7 +16071,7 @@
|
|
|
15811
16071
|
result = coerceValue(type, result);
|
|
15812
16072
|
}
|
|
15813
16073
|
}
|
|
15814
|
-
if (type && type !== this.type || result !== void 0 && typeOf(result)
|
|
16074
|
+
if (type && type !== this.type || result !== void 0 && !typeEquals(typeOf(result), this.type)) {
|
|
15815
16075
|
result = coerceValue(this.type.kind, result);
|
|
15816
16076
|
}
|
|
15817
16077
|
return result;
|
|
@@ -15827,84 +16087,12 @@
|
|
|
15827
16087
|
this.key
|
|
15828
16088
|
];
|
|
15829
16089
|
if (this.scope) {
|
|
15830
|
-
res.concat(this.
|
|
16090
|
+
res.concat(this.scope);
|
|
15831
16091
|
}
|
|
15832
16092
|
return res;
|
|
15833
16093
|
}
|
|
15834
16094
|
}
|
|
15835
16095
|
|
|
15836
|
-
function isFeatureConstant(e) {
|
|
15837
|
-
if (e instanceof CompoundExpression) {
|
|
15838
|
-
if (e.name === 'get' && e.args.length === 1) {
|
|
15839
|
-
return false;
|
|
15840
|
-
} else if (e.name === 'feature-state') {
|
|
15841
|
-
return false;
|
|
15842
|
-
} else if (e.name === 'has' && e.args.length === 1) {
|
|
15843
|
-
return false;
|
|
15844
|
-
} else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {
|
|
15845
|
-
return false;
|
|
15846
|
-
} else if (/^filter-/.test(e.name)) {
|
|
15847
|
-
return false;
|
|
15848
|
-
}
|
|
15849
|
-
}
|
|
15850
|
-
if (e instanceof Within) {
|
|
15851
|
-
return false;
|
|
15852
|
-
}
|
|
15853
|
-
if (e instanceof Distance) {
|
|
15854
|
-
return false;
|
|
15855
|
-
}
|
|
15856
|
-
let result = true;
|
|
15857
|
-
e.eachChild(arg => {
|
|
15858
|
-
if (result && !isFeatureConstant(arg)) {
|
|
15859
|
-
result = false;
|
|
15860
|
-
}
|
|
15861
|
-
});
|
|
15862
|
-
return result;
|
|
15863
|
-
}
|
|
15864
|
-
function isStateConstant(e) {
|
|
15865
|
-
if (e instanceof CompoundExpression) {
|
|
15866
|
-
if (e.name === 'feature-state') {
|
|
15867
|
-
return false;
|
|
15868
|
-
}
|
|
15869
|
-
}
|
|
15870
|
-
let result = true;
|
|
15871
|
-
e.eachChild(arg => {
|
|
15872
|
-
if (result && !isStateConstant(arg)) {
|
|
15873
|
-
result = false;
|
|
15874
|
-
}
|
|
15875
|
-
});
|
|
15876
|
-
return result;
|
|
15877
|
-
}
|
|
15878
|
-
function getConfigDependencies(e) {
|
|
15879
|
-
if (e instanceof Config) {
|
|
15880
|
-
const singleConfig = /* @__PURE__ */
|
|
15881
|
-
new Set([e.key]);
|
|
15882
|
-
return singleConfig;
|
|
15883
|
-
}
|
|
15884
|
-
let result = /* @__PURE__ */
|
|
15885
|
-
new Set();
|
|
15886
|
-
e.eachChild(arg => {
|
|
15887
|
-
result = /* @__PURE__ */
|
|
15888
|
-
new Set([
|
|
15889
|
-
...result,
|
|
15890
|
-
...getConfigDependencies(arg)
|
|
15891
|
-
]);
|
|
15892
|
-
});
|
|
15893
|
-
return result;
|
|
15894
|
-
}
|
|
15895
|
-
function isGlobalPropertyConstant(e, properties) {
|
|
15896
|
-
if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {
|
|
15897
|
-
return false;
|
|
15898
|
-
}
|
|
15899
|
-
let result = true;
|
|
15900
|
-
e.eachChild(arg => {
|
|
15901
|
-
if (result && !isGlobalPropertyConstant(arg, properties)) {
|
|
15902
|
-
result = false;
|
|
15903
|
-
}
|
|
15904
|
-
});
|
|
15905
|
-
return result;
|
|
15906
|
-
}
|
|
15907
|
-
|
|
15908
16096
|
class Var {
|
|
15909
16097
|
constructor(name, boundExpression) {
|
|
15910
16098
|
this.type = boundExpression.type;
|
|
@@ -15920,6 +16108,7 @@
|
|
|
15920
16108
|
}
|
|
15921
16109
|
return new Var(name, context.scope.get(name));
|
|
15922
16110
|
}
|
|
16111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15923
16112
|
evaluate(ctx) {
|
|
15924
16113
|
return this.boundExpression.evaluate(ctx);
|
|
15925
16114
|
}
|
|
@@ -16071,7 +16260,6 @@
|
|
|
16071
16260
|
return error;
|
|
16072
16261
|
}
|
|
16073
16262
|
}
|
|
16074
|
-
var ParsingContext$1 = ParsingContext;
|
|
16075
16263
|
function isConstant(expression) {
|
|
16076
16264
|
if (expression instanceof Var) {
|
|
16077
16265
|
return isConstant(expression.boundExpression);
|
|
@@ -16101,6 +16289,7 @@
|
|
|
16101
16289
|
return isFeatureConstant(expression) && isGlobalPropertyConstant(expression, [
|
|
16102
16290
|
'zoom',
|
|
16103
16291
|
'heatmap-density',
|
|
16292
|
+
'worldview',
|
|
16104
16293
|
'line-progress',
|
|
16105
16294
|
'raster-value',
|
|
16106
16295
|
'sky-radial-progress',
|
|
@@ -16185,6 +16374,7 @@
|
|
|
16185
16374
|
}
|
|
16186
16375
|
return new Step(outputType, input, stops);
|
|
16187
16376
|
}
|
|
16377
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16188
16378
|
evaluate(ctx) {
|
|
16189
16379
|
const labels = this.labels;
|
|
16190
16380
|
const outputs = this.outputs;
|
|
@@ -16587,6 +16777,7 @@
|
|
|
16587
16777
|
const needsAnnotation = expectedType && parsedArgs.some(arg => checkSubtype(expectedType, arg.type));
|
|
16588
16778
|
return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);
|
|
16589
16779
|
}
|
|
16780
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16590
16781
|
evaluate(ctx) {
|
|
16591
16782
|
let result = null;
|
|
16592
16783
|
let argCount = 0;
|
|
@@ -16629,6 +16820,7 @@
|
|
|
16629
16820
|
this.bindings = [].concat(bindings);
|
|
16630
16821
|
this.result = result;
|
|
16631
16822
|
}
|
|
16823
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16632
16824
|
evaluate(ctx) {
|
|
16633
16825
|
return this.result.evaluate(ctx);
|
|
16634
16826
|
}
|
|
@@ -16871,6 +17063,7 @@
|
|
|
16871
17063
|
return new IndexOf(needle, haystack);
|
|
16872
17064
|
}
|
|
16873
17065
|
}
|
|
17066
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16874
17067
|
evaluate(ctx) {
|
|
16875
17068
|
const needle = this.needle.evaluate(ctx);
|
|
16876
17069
|
const haystack = this.haystack.evaluate(ctx);
|
|
@@ -16987,9 +17180,10 @@
|
|
|
16987
17180
|
}
|
|
16988
17181
|
return new Match(inputType, outputType, input, cases, outputs, otherwise);
|
|
16989
17182
|
}
|
|
17183
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16990
17184
|
evaluate(ctx) {
|
|
16991
17185
|
const input = this.input.evaluate(ctx);
|
|
16992
|
-
const output = typeOf(input)
|
|
17186
|
+
const output = typeEquals(typeOf(input), this.inputType) && this.outputs[this.cases[input]] || this.otherwise;
|
|
16993
17187
|
return output.evaluate(ctx);
|
|
16994
17188
|
}
|
|
16995
17189
|
eachChild(fn) {
|
|
@@ -17068,6 +17262,7 @@
|
|
|
17068
17262
|
return null;
|
|
17069
17263
|
return new Case(outputType, branches, otherwise);
|
|
17070
17264
|
}
|
|
17265
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17071
17266
|
evaluate(ctx) {
|
|
17072
17267
|
for (const [test, expression] of this.branches) {
|
|
17073
17268
|
if (test.evaluate(ctx)) {
|
|
@@ -17126,6 +17321,7 @@
|
|
|
17126
17321
|
return new Slice(input.type, input, beginIndex);
|
|
17127
17322
|
}
|
|
17128
17323
|
}
|
|
17324
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17129
17325
|
evaluate(ctx) {
|
|
17130
17326
|
const input = this.input.evaluate(ctx);
|
|
17131
17327
|
const beginIndex = this.beginIndex.evaluate(ctx);
|
|
@@ -17510,7 +17706,7 @@
|
|
|
17510
17706
|
const error = validateRGBA(r, g, b, alpha);
|
|
17511
17707
|
if (error)
|
|
17512
17708
|
throw new RuntimeError(error);
|
|
17513
|
-
return new Color(r / 255
|
|
17709
|
+
return new Color(r / 255, g / 255, b / 255, alpha);
|
|
17514
17710
|
}
|
|
17515
17711
|
function hsla(ctx, [h, s, l, a]) {
|
|
17516
17712
|
h = h.evaluate(ctx);
|
|
@@ -17577,14 +17773,14 @@
|
|
|
17577
17773
|
array$1(NumberType, 4),
|
|
17578
17774
|
[ColorType],
|
|
17579
17775
|
(ctx, [v]) => {
|
|
17580
|
-
return v.evaluate(ctx).
|
|
17776
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toArray();
|
|
17581
17777
|
}
|
|
17582
17778
|
],
|
|
17583
17779
|
'to-hsla': [
|
|
17584
17780
|
array$1(NumberType, 4),
|
|
17585
17781
|
[ColorType],
|
|
17586
17782
|
(ctx, [v]) => {
|
|
17587
|
-
return v.evaluate(ctx).
|
|
17783
|
+
return v.evaluate(ctx).toNonPremultipliedRenderColor(null).toHslaArray();
|
|
17588
17784
|
}
|
|
17589
17785
|
],
|
|
17590
17786
|
'rgb': [
|
|
@@ -17646,6 +17842,7 @@
|
|
|
17646
17842
|
overloads: [
|
|
17647
17843
|
[
|
|
17648
17844
|
[StringType],
|
|
17845
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17649
17846
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.properties())
|
|
17650
17847
|
],
|
|
17651
17848
|
[
|
|
@@ -17653,6 +17850,7 @@
|
|
|
17653
17850
|
StringType,
|
|
17654
17851
|
ObjectType
|
|
17655
17852
|
],
|
|
17853
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17656
17854
|
(ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))
|
|
17657
17855
|
]
|
|
17658
17856
|
]
|
|
@@ -17660,6 +17858,7 @@
|
|
|
17660
17858
|
'feature-state': [
|
|
17661
17859
|
ValueType,
|
|
17662
17860
|
[StringType],
|
|
17861
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17663
17862
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})
|
|
17664
17863
|
],
|
|
17665
17864
|
'properties': [
|
|
@@ -17672,6 +17871,11 @@
|
|
|
17672
17871
|
[],
|
|
17673
17872
|
ctx => ctx.geometryType()
|
|
17674
17873
|
],
|
|
17874
|
+
'worldview': [
|
|
17875
|
+
StringType,
|
|
17876
|
+
[],
|
|
17877
|
+
ctx => ctx.globals.worldview || ''
|
|
17878
|
+
],
|
|
17675
17879
|
'id': [
|
|
17676
17880
|
ValueType,
|
|
17677
17881
|
[],
|
|
@@ -17857,11 +18061,13 @@
|
|
|
17857
18061
|
'min': [
|
|
17858
18062
|
NumberType,
|
|
17859
18063
|
varargs(NumberType),
|
|
18064
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17860
18065
|
(ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))
|
|
17861
18066
|
],
|
|
17862
18067
|
'max': [
|
|
17863
18068
|
NumberType,
|
|
17864
18069
|
varargs(NumberType),
|
|
18070
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17865
18071
|
(ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))
|
|
17866
18072
|
],
|
|
17867
18073
|
'abs': [
|
|
@@ -18035,6 +18241,7 @@
|
|
|
18035
18241
|
BooleanType,
|
|
18036
18242
|
BooleanType
|
|
18037
18243
|
],
|
|
18244
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18038
18245
|
(ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)
|
|
18039
18246
|
],
|
|
18040
18247
|
[
|
|
@@ -18057,6 +18264,7 @@
|
|
|
18057
18264
|
BooleanType,
|
|
18058
18265
|
BooleanType
|
|
18059
18266
|
],
|
|
18267
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18060
18268
|
(ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)
|
|
18061
18269
|
],
|
|
18062
18270
|
[
|
|
@@ -18091,11 +18299,13 @@
|
|
|
18091
18299
|
'upcase': [
|
|
18092
18300
|
StringType,
|
|
18093
18301
|
[StringType],
|
|
18302
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18094
18303
|
(ctx, [s]) => s.evaluate(ctx).toUpperCase()
|
|
18095
18304
|
],
|
|
18096
18305
|
'downcase': [
|
|
18097
18306
|
StringType,
|
|
18098
18307
|
[StringType],
|
|
18308
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18099
18309
|
(ctx, [s]) => s.evaluate(ctx).toLowerCase()
|
|
18100
18310
|
],
|
|
18101
18311
|
'concat': [
|
|
@@ -18106,6 +18316,7 @@
|
|
|
18106
18316
|
'resolved-locale': [
|
|
18107
18317
|
StringType,
|
|
18108
18318
|
[CollatorType],
|
|
18319
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18109
18320
|
(ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()
|
|
18110
18321
|
],
|
|
18111
18322
|
'random': [
|
|
@@ -18253,6 +18464,7 @@
|
|
|
18253
18464
|
kind: 'composite',
|
|
18254
18465
|
interpolationType,
|
|
18255
18466
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18467
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18256
18468
|
zoomStops: featureFunctionStops.map(s => s[0]),
|
|
18257
18469
|
evaluate({zoom}, properties) {
|
|
18258
18470
|
return evaluateExponentialFunction({
|
|
@@ -18270,7 +18482,9 @@
|
|
|
18270
18482
|
kind: 'camera',
|
|
18271
18483
|
interpolationType,
|
|
18272
18484
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18485
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18273
18486
|
zoomStops: parameters.stops.map(s => s[0]),
|
|
18487
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18274
18488
|
evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)
|
|
18275
18489
|
};
|
|
18276
18490
|
} else {
|
|
@@ -18422,7 +18636,7 @@
|
|
|
18422
18636
|
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === 'string' && expression[0] in expressions;
|
|
18423
18637
|
}
|
|
18424
18638
|
function createExpression(expression, propertySpec, scope, options) {
|
|
18425
|
-
const parser = new ParsingContext
|
|
18639
|
+
const parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0, void 0, void 0, scope, options);
|
|
18426
18640
|
const parsed = parser.parse(expression, void 0, void 0, void 0, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : void 0);
|
|
18427
18641
|
if (!parsed) {
|
|
18428
18642
|
return error(parser.errors);
|
|
@@ -19376,7 +19590,8 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19376
19590
|
negate
|
|
19377
19591
|
];
|
|
19378
19592
|
}
|
|
19379
|
-
return [negate ? 'all' : 'any'].concat(
|
|
19593
|
+
return [negate ? 'all' : 'any'].concat(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19594
|
+
values.map(v => [
|
|
19380
19595
|
negate ? '!=' : '==',
|
|
19381
19596
|
get,
|
|
19382
19597
|
v
|
|
@@ -19965,7 +20180,10 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19965
20180
|
}
|
|
19966
20181
|
for (const afterImport of after) {
|
|
19967
20182
|
const beforeImport = beforeIndex[afterImport.id];
|
|
19968
|
-
if (!beforeImport
|
|
20183
|
+
if (!beforeImport)
|
|
20184
|
+
continue;
|
|
20185
|
+
delete beforeImport.data;
|
|
20186
|
+
if (deepEqual(beforeImport, afterImport))
|
|
19969
20187
|
continue;
|
|
19970
20188
|
commands.push({
|
|
19971
20189
|
command: operations.updateImport,
|
|
@@ -20450,7 +20668,6 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
20450
20668
|
errors2 = errors2.concat(validateStopDomainValue({
|
|
20451
20669
|
key: `${ key }[0]`,
|
|
20452
20670
|
value: value[0],
|
|
20453
|
-
valueSpec: {},
|
|
20454
20671
|
style: options2.style,
|
|
20455
20672
|
styleSpec: options2.styleSpec
|
|
20456
20673
|
}, value));
|
|
@@ -21045,10 +21262,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21045
21262
|
return validateEnum({
|
|
21046
21263
|
key: `${ key }.type`,
|
|
21047
21264
|
value: value.type,
|
|
21048
|
-
valueSpec: { values: getSourceTypeValues(styleSpec) }
|
|
21049
|
-
style,
|
|
21050
|
-
styleSpec
|
|
21051
|
-
});
|
|
21265
|
+
valueSpec: { values: getSourceTypeValues(styleSpec) }});
|
|
21052
21266
|
}
|
|
21053
21267
|
}
|
|
21054
21268
|
function getSourceTypeValues(styleSpec) {
|
|
@@ -21227,7 +21441,25 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21227
21441
|
return errors;
|
|
21228
21442
|
}
|
|
21229
21443
|
for (const propertyKey in properties) {
|
|
21230
|
-
|
|
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]) {
|
|
21231
21463
|
errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${ propertyKey }"`)]);
|
|
21232
21464
|
} else {
|
|
21233
21465
|
errors = errors.concat(validate({
|
|
@@ -21240,25 +21472,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21240
21472
|
}
|
|
21241
21473
|
}
|
|
21242
21474
|
} else {
|
|
21243
|
-
|
|
21244
|
-
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
21245
|
-
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
21246
|
-
errors = errors.concat(validate({
|
|
21247
|
-
key: key2,
|
|
21248
|
-
value: light[key2],
|
|
21249
|
-
valueSpec: { type: 'string' },
|
|
21250
|
-
style,
|
|
21251
|
-
styleSpec
|
|
21252
|
-
}));
|
|
21253
|
-
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
21254
|
-
errors = errors.concat(validate({
|
|
21255
|
-
key: key2,
|
|
21256
|
-
value: light[key2],
|
|
21257
|
-
valueSpec: styleSpec.transition,
|
|
21258
|
-
style,
|
|
21259
|
-
styleSpec
|
|
21260
|
-
}));
|
|
21261
|
-
} else if (lightSpec[key2]) {
|
|
21475
|
+
if (lightSpec[key2]) {
|
|
21262
21476
|
errors = errors.concat(validate({
|
|
21263
21477
|
key: key2,
|
|
21264
21478
|
value: light[key2],
|
|
@@ -22632,7 +22846,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
22632
22846
|
return !!value.match(regex);
|
|
22633
22847
|
}
|
|
22634
22848
|
function getSourceCount(source) {
|
|
22635
|
-
if (source
|
|
22849
|
+
if ('url' in source) {
|
|
22636
22850
|
return source.url.split(',').length;
|
|
22637
22851
|
} else {
|
|
22638
22852
|
return 0;
|
|
@@ -22671,7 +22885,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
22671
22885
|
errors.push(new ValidationError(`sources[${ i }].type`, source.type, `Expected one of [${ Array.from(acceptedSourceTypes).join(', ') }]`));
|
|
22672
22886
|
}
|
|
22673
22887
|
const sourceUrlPattern = /^mapbox:\/\/([^/]*)$/;
|
|
22674
|
-
if (!
|
|
22888
|
+
if (!('url' in source) || !isValid(source.url, sourceUrlPattern)) {
|
|
22675
22889
|
errors.push(new ValidationError(`sources[${ i }].url`, source.url, 'Expected a valid Mapbox tileset url'));
|
|
22676
22890
|
}
|
|
22677
22891
|
return errors;
|