@mapbox/mapbox-gl-style-spec 14.8.0-beta.1 → 14.9.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/diff.ts +16 -0
- package/dist/index.cjs +861 -153
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +171 -9
- package/dist/index.es.js +861 -153
- package/dist/index.es.js.map +1 -1
- package/expression/definitions/coercion.ts +1 -1
- package/expression/definitions/config.ts +1 -1
- package/expression/definitions/image.ts +184 -14
- package/expression/definitions/index.ts +7 -0
- package/expression/definitions/interpolate.ts +54 -13
- package/expression/expression.ts +1 -0
- package/expression/index.ts +23 -9
- package/expression/types/formatted.ts +1 -1
- package/expression/types/image_id_with_options.ts +54 -0
- package/expression/types/resolved_image.ts +49 -7
- package/expression/values.ts +9 -7
- package/feature_filter/index.ts +13 -7
- package/function/index.ts +1 -1
- package/group_by_layout.ts +35 -3
- package/package.json +1 -1
- package/reference/v8.json +407 -88
- package/types.ts +128 -9
- package/util/color.ts +62 -1
- package/util/properties.ts +4 -0
- package/validate/validate_fog.ts +10 -1
- package/validate/validate_function.ts +1 -1
- package/validate/validate_light.ts +10 -1
- package/validate/validate_lights.ts +11 -1
- package/validate/validate_property.ts +11 -0
- package/validate/validate_rain.ts +47 -0
- package/validate/validate_snow.ts +47 -0
- package/validate/validate_terrain.ts +11 -2
- package/validate_style.min.ts +4 -0
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,16 @@
|
|
|
113
113
|
type: "fog",
|
|
114
114
|
doc: "A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."
|
|
115
115
|
},
|
|
116
|
+
snow: {
|
|
117
|
+
type: "snow",
|
|
118
|
+
doc: "Global precipitation particle-based snow. Having snow present in the style forces constant map repaint mode",
|
|
119
|
+
experimental: true
|
|
120
|
+
},
|
|
121
|
+
rain: {
|
|
122
|
+
type: "rain",
|
|
123
|
+
doc: "Global precipitation particle-based rain effect. Having rain present in the style forces constant map repaint mode.",
|
|
124
|
+
experimental: true
|
|
125
|
+
},
|
|
116
126
|
camera: {
|
|
117
127
|
type: "camera",
|
|
118
128
|
doc: "Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."
|
|
@@ -121,6 +131,11 @@
|
|
|
121
131
|
type: "colorTheme",
|
|
122
132
|
doc: "A global modifier for the colors of the style."
|
|
123
133
|
},
|
|
134
|
+
indoor: {
|
|
135
|
+
type: "indoor",
|
|
136
|
+
experimental: true,
|
|
137
|
+
doc: "Controls the behaviour of indoor features."
|
|
138
|
+
},
|
|
124
139
|
imports: {
|
|
125
140
|
type: "array",
|
|
126
141
|
value: "import",
|
|
@@ -218,7 +233,7 @@
|
|
|
218
233
|
featuresets: {
|
|
219
234
|
experimental: true,
|
|
220
235
|
type: "featuresets",
|
|
221
|
-
doc: "Defines sets of features for querying, interaction, and
|
|
236
|
+
doc: "Defines sets of features for querying, interaction, and state management on the map, referencing individual layers or subsets of layers within the map's style.",
|
|
222
237
|
example: {
|
|
223
238
|
poi: {
|
|
224
239
|
selectors: [
|
|
@@ -461,6 +476,28 @@
|
|
|
461
476
|
}
|
|
462
477
|
}
|
|
463
478
|
},
|
|
479
|
+
"shadow-quality": {
|
|
480
|
+
type: "number",
|
|
481
|
+
"property-type": "data-constant",
|
|
482
|
+
"default": 1,
|
|
483
|
+
minimum: 0,
|
|
484
|
+
maximum: 1,
|
|
485
|
+
expression: {
|
|
486
|
+
interpolated: false,
|
|
487
|
+
parameters: [
|
|
488
|
+
"zoom"
|
|
489
|
+
]
|
|
490
|
+
},
|
|
491
|
+
transition: false,
|
|
492
|
+
doc: "Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value.",
|
|
493
|
+
"sdk-support": {
|
|
494
|
+
"basic functionality": {
|
|
495
|
+
android: "11.9.0",
|
|
496
|
+
ios: "11.9.0"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
experimental: true
|
|
500
|
+
},
|
|
464
501
|
"shadow-intensity": {
|
|
465
502
|
type: "number",
|
|
466
503
|
"property-type": "data-constant",
|
|
@@ -1585,6 +1622,35 @@
|
|
|
1585
1622
|
interpolated: false
|
|
1586
1623
|
},
|
|
1587
1624
|
"property-type": "constant"
|
|
1625
|
+
},
|
|
1626
|
+
"fill-elevation-reference": {
|
|
1627
|
+
type: "enum",
|
|
1628
|
+
doc: "Selects the base of fill-elevation. Some modes might require precomputed elevation data in the tileset.",
|
|
1629
|
+
values: {
|
|
1630
|
+
none: {
|
|
1631
|
+
doc: "Elevated rendering is disabled."
|
|
1632
|
+
},
|
|
1633
|
+
"hd-road-base": {
|
|
1634
|
+
doc: "Elevate geometry relative to HD roads. Use this mode to describe base polygons of the road networks."
|
|
1635
|
+
},
|
|
1636
|
+
"hd-road-markup": {
|
|
1637
|
+
doc: "Elevated rendering is enabled. Use this mode to describe additive and stackable features such as 'hatched areas' that should exist only on top of road polygons."
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
"default": "none",
|
|
1641
|
+
experimental: true,
|
|
1642
|
+
"private": true,
|
|
1643
|
+
transition: false,
|
|
1644
|
+
"sdk-support": {
|
|
1645
|
+
"basic functionality": {
|
|
1646
|
+
android: "11.9.0",
|
|
1647
|
+
ios: "11.9.0"
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1650
|
+
expression: {
|
|
1651
|
+
interpolated: false
|
|
1652
|
+
},
|
|
1653
|
+
"property-type": "data-constant"
|
|
1588
1654
|
}
|
|
1589
1655
|
};
|
|
1590
1656
|
var layout_circle = {
|
|
@@ -1933,6 +1999,36 @@
|
|
|
1933
1999
|
interpolated: false
|
|
1934
2000
|
},
|
|
1935
2001
|
"property-type": "constant"
|
|
2002
|
+
},
|
|
2003
|
+
"line-width-unit": {
|
|
2004
|
+
type: "enum",
|
|
2005
|
+
doc: "Selects the unit of line-width. The same unit is automatically used for line-blur and line-offset. Note: This is an experimental property and might be removed in a future release.",
|
|
2006
|
+
values: {
|
|
2007
|
+
pixels: {
|
|
2008
|
+
doc: "Width is rendered in pixels."
|
|
2009
|
+
},
|
|
2010
|
+
meters: {
|
|
2011
|
+
doc: "Width is rendered in meters."
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
"default": "pixels",
|
|
2015
|
+
experimental: true,
|
|
2016
|
+
"private": true,
|
|
2017
|
+
transition: false,
|
|
2018
|
+
"sdk-support": {
|
|
2019
|
+
"basic functionality": {
|
|
2020
|
+
js: "3.9.0",
|
|
2021
|
+
android: "11.9.0",
|
|
2022
|
+
ios: "11.9.0"
|
|
2023
|
+
}
|
|
2024
|
+
},
|
|
2025
|
+
expression: {
|
|
2026
|
+
interpolated: false,
|
|
2027
|
+
parameters: [
|
|
2028
|
+
"zoom"
|
|
2029
|
+
]
|
|
2030
|
+
},
|
|
2031
|
+
"property-type": "data-constant"
|
|
1936
2032
|
}
|
|
1937
2033
|
};
|
|
1938
2034
|
var layout_symbol = {
|
|
@@ -2047,7 +2143,7 @@
|
|
|
2047
2143
|
doc: "Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."
|
|
2048
2144
|
},
|
|
2049
2145
|
"viewport-y": {
|
|
2050
|
-
doc: "Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap
|
|
2146
|
+
doc: "Sorts symbols by their y-position relative to the viewport if any of the following is set to `true`: `icon-allow-overlap`, `text-allow-overlap`, `icon-ignore-placement`, `text-ignore-placement`."
|
|
2051
2147
|
},
|
|
2052
2148
|
source: {
|
|
2053
2149
|
doc: "Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."
|
|
@@ -2101,6 +2197,36 @@
|
|
|
2101
2197
|
},
|
|
2102
2198
|
"property-type": "data-constant"
|
|
2103
2199
|
},
|
|
2200
|
+
"symbol-elevation-reference": {
|
|
2201
|
+
type: "enum",
|
|
2202
|
+
doc: "Selects the base of symbol-elevation.",
|
|
2203
|
+
values: {
|
|
2204
|
+
sea: {
|
|
2205
|
+
doc: "Elevate symbols relative to the sea level."
|
|
2206
|
+
},
|
|
2207
|
+
ground: {
|
|
2208
|
+
doc: "Elevate symbols relative to the ground's height below them."
|
|
2209
|
+
},
|
|
2210
|
+
"hd-road-markup": {
|
|
2211
|
+
doc: "Use this mode to enable elevated behavior for features that are rendered on top of 3D road polygons. The feature is currently being developed."
|
|
2212
|
+
}
|
|
2213
|
+
},
|
|
2214
|
+
"default": "ground",
|
|
2215
|
+
experimental: true,
|
|
2216
|
+
"sdk-support": {
|
|
2217
|
+
"basic functionality": {
|
|
2218
|
+
android: "11.9.0",
|
|
2219
|
+
ios: "11.9.0"
|
|
2220
|
+
}
|
|
2221
|
+
},
|
|
2222
|
+
expression: {
|
|
2223
|
+
interpolated: false,
|
|
2224
|
+
parameters: [
|
|
2225
|
+
"zoom"
|
|
2226
|
+
]
|
|
2227
|
+
},
|
|
2228
|
+
"property-type": "data-constant"
|
|
2229
|
+
},
|
|
2104
2230
|
"icon-allow-overlap": {
|
|
2105
2231
|
type: "boolean",
|
|
2106
2232
|
"default": false,
|
|
@@ -2254,9 +2380,7 @@
|
|
|
2254
2380
|
},
|
|
2255
2381
|
"sdk-support": {
|
|
2256
2382
|
"basic functionality": {
|
|
2257
|
-
js: "3.8.0"
|
|
2258
|
-
android: "11.8.0",
|
|
2259
|
-
ios: "11.8.0"
|
|
2383
|
+
js: "3.8.0"
|
|
2260
2384
|
}
|
|
2261
2385
|
},
|
|
2262
2386
|
"property-type": "data-constant"
|
|
@@ -2768,9 +2892,7 @@
|
|
|
2768
2892
|
},
|
|
2769
2893
|
"sdk-support": {
|
|
2770
2894
|
"basic functionality": {
|
|
2771
|
-
js: "3.8.0"
|
|
2772
|
-
android: "11.8.0",
|
|
2773
|
-
ios: "11.8.0"
|
|
2895
|
+
js: "3.8.0"
|
|
2774
2896
|
}
|
|
2775
2897
|
},
|
|
2776
2898
|
"property-type": "data-constant"
|
|
@@ -3474,6 +3596,62 @@
|
|
|
3474
3596
|
]
|
|
3475
3597
|
}
|
|
3476
3598
|
};
|
|
3599
|
+
var filter_hillshade = {
|
|
3600
|
+
type: "boolean",
|
|
3601
|
+
doc: "Expression which determines whether or not to enable the hillshade layer. Hillshade layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
3602
|
+
"default": false,
|
|
3603
|
+
transition: false,
|
|
3604
|
+
"property-type": "data-driven",
|
|
3605
|
+
expression: {
|
|
3606
|
+
interpolated: false,
|
|
3607
|
+
parameters: [
|
|
3608
|
+
"zoom",
|
|
3609
|
+
"feature"
|
|
3610
|
+
]
|
|
3611
|
+
}
|
|
3612
|
+
};
|
|
3613
|
+
var filter_raster = {
|
|
3614
|
+
type: "boolean",
|
|
3615
|
+
doc: "Expression which determines whether or not to enable the raster layer. Raster layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
3616
|
+
"default": false,
|
|
3617
|
+
transition: false,
|
|
3618
|
+
"property-type": "data-driven",
|
|
3619
|
+
expression: {
|
|
3620
|
+
interpolated: false,
|
|
3621
|
+
parameters: [
|
|
3622
|
+
"zoom",
|
|
3623
|
+
"feature"
|
|
3624
|
+
]
|
|
3625
|
+
}
|
|
3626
|
+
};
|
|
3627
|
+
var filter_clip = {
|
|
3628
|
+
type: "boolean",
|
|
3629
|
+
doc: "Expression which determines whether or not to enable the clip layer. Clip layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
3630
|
+
"default": false,
|
|
3631
|
+
transition: false,
|
|
3632
|
+
"property-type": "data-driven",
|
|
3633
|
+
expression: {
|
|
3634
|
+
interpolated: false,
|
|
3635
|
+
parameters: [
|
|
3636
|
+
"zoom",
|
|
3637
|
+
"feature"
|
|
3638
|
+
]
|
|
3639
|
+
}
|
|
3640
|
+
};
|
|
3641
|
+
var filter_model = {
|
|
3642
|
+
type: "boolean",
|
|
3643
|
+
doc: "Expression which determines whether or not to display a model. Model layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
3644
|
+
"default": false,
|
|
3645
|
+
transition: false,
|
|
3646
|
+
"property-type": "data-driven",
|
|
3647
|
+
expression: {
|
|
3648
|
+
interpolated: false,
|
|
3649
|
+
parameters: [
|
|
3650
|
+
"zoom",
|
|
3651
|
+
"feature"
|
|
3652
|
+
]
|
|
3653
|
+
}
|
|
3654
|
+
};
|
|
3477
3655
|
var filter_line = {
|
|
3478
3656
|
type: "boolean",
|
|
3479
3657
|
doc: "Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
@@ -3965,6 +4143,17 @@
|
|
|
3965
4143
|
}
|
|
3966
4144
|
}
|
|
3967
4145
|
},
|
|
4146
|
+
"to-hsla": {
|
|
4147
|
+
doc: "Returns a four-element array containing the input color's Hue, Saturation, Luminance and alpha components, in that order.",
|
|
4148
|
+
group: "Color",
|
|
4149
|
+
"sdk-support": {
|
|
4150
|
+
"basic functionality": {
|
|
4151
|
+
js: "3.9.0",
|
|
4152
|
+
android: "11.9.0",
|
|
4153
|
+
ios: "11.9.0"
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
},
|
|
3968
4157
|
"to-color": {
|
|
3969
4158
|
doc: "Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",
|
|
3970
4159
|
group: "Types",
|
|
@@ -4153,7 +4342,7 @@
|
|
|
4153
4342
|
}
|
|
4154
4343
|
},
|
|
4155
4344
|
"line-progress": {
|
|
4156
|
-
doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient`
|
|
4345
|
+
doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient` and `line-z-offset` properties.",
|
|
4157
4346
|
group: "Feature data",
|
|
4158
4347
|
"sdk-support": {
|
|
4159
4348
|
"basic functionality": {
|
|
@@ -4898,11 +5087,11 @@
|
|
|
4898
5087
|
relaxZoomRestriction: true
|
|
4899
5088
|
},
|
|
4900
5089
|
transition: true,
|
|
4901
|
-
doc: "Snow particles density.",
|
|
5090
|
+
doc: "Snow particles density. Controls the overall particles number.",
|
|
4902
5091
|
"sdk-support": {
|
|
4903
5092
|
"basic functionality": {
|
|
4904
|
-
android: "11.
|
|
4905
|
-
ios: "11.
|
|
5093
|
+
android: "11.9.0",
|
|
5094
|
+
ios: "11.9.0"
|
|
4906
5095
|
}
|
|
4907
5096
|
}
|
|
4908
5097
|
},
|
|
@@ -4922,11 +5111,11 @@
|
|
|
4922
5111
|
relaxZoomRestriction: true
|
|
4923
5112
|
},
|
|
4924
5113
|
transition: true,
|
|
4925
|
-
doc: "Snow particles movement factor.",
|
|
5114
|
+
doc: "Snow particles movement factor. Controls the overall particles movement speed.",
|
|
4926
5115
|
"sdk-support": {
|
|
4927
5116
|
"basic functionality": {
|
|
4928
|
-
android: "11.
|
|
4929
|
-
ios: "11.
|
|
5117
|
+
android: "11.9.0",
|
|
5118
|
+
ios: "11.9.0"
|
|
4930
5119
|
}
|
|
4931
5120
|
}
|
|
4932
5121
|
},
|
|
@@ -4947,15 +5136,15 @@
|
|
|
4947
5136
|
doc: "Snow particles color.",
|
|
4948
5137
|
"sdk-support": {
|
|
4949
5138
|
"basic functionality": {
|
|
4950
|
-
android: "11.
|
|
4951
|
-
ios: "11.
|
|
5139
|
+
android: "11.9.0",
|
|
5140
|
+
ios: "11.9.0"
|
|
4952
5141
|
}
|
|
4953
5142
|
}
|
|
4954
5143
|
},
|
|
4955
5144
|
opacity: {
|
|
4956
5145
|
type: "number",
|
|
4957
5146
|
"property-type": "data-constant",
|
|
4958
|
-
"default":
|
|
5147
|
+
"default": 0.9,
|
|
4959
5148
|
minimum: 0,
|
|
4960
5149
|
maximum: 1,
|
|
4961
5150
|
experimental: true,
|
|
@@ -4971,15 +5160,15 @@
|
|
|
4971
5160
|
doc: "Snow particles opacity.",
|
|
4972
5161
|
"sdk-support": {
|
|
4973
5162
|
"basic functionality": {
|
|
4974
|
-
android: "11.
|
|
4975
|
-
ios: "11.
|
|
5163
|
+
android: "11.9.0",
|
|
5164
|
+
ios: "11.9.0"
|
|
4976
5165
|
}
|
|
4977
5166
|
}
|
|
4978
5167
|
},
|
|
4979
5168
|
vignette: {
|
|
4980
5169
|
type: "number",
|
|
4981
5170
|
"property-type": "data-constant",
|
|
4982
|
-
"default": 0,
|
|
5171
|
+
"default": 0.3,
|
|
4983
5172
|
minimum: 0,
|
|
4984
5173
|
maximum: 1,
|
|
4985
5174
|
experimental: true,
|
|
@@ -4992,15 +5181,37 @@
|
|
|
4992
5181
|
relaxZoomRestriction: true
|
|
4993
5182
|
},
|
|
4994
5183
|
transition: true,
|
|
4995
|
-
doc: "Snow vignette screen-space effect.",
|
|
5184
|
+
doc: "Snow vignette screen-space effect. Adds snow tint to screen corners",
|
|
4996
5185
|
"sdk-support": {
|
|
4997
5186
|
"basic functionality": {
|
|
4998
|
-
android: "11.
|
|
4999
|
-
ios: "11.
|
|
5187
|
+
android: "11.9.0",
|
|
5188
|
+
ios: "11.9.0"
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
},
|
|
5192
|
+
"vignette-color": {
|
|
5193
|
+
type: "color",
|
|
5194
|
+
"property-type": "data-constant",
|
|
5195
|
+
"default": "#ffffff",
|
|
5196
|
+
experimental: true,
|
|
5197
|
+
expression: {
|
|
5198
|
+
interpolated: true,
|
|
5199
|
+
parameters: [
|
|
5200
|
+
"zoom",
|
|
5201
|
+
"measure-light"
|
|
5202
|
+
],
|
|
5203
|
+
relaxZoomRestriction: true
|
|
5204
|
+
},
|
|
5205
|
+
transition: true,
|
|
5206
|
+
doc: "Snow vignette screen-space corners tint color.",
|
|
5207
|
+
"sdk-support": {
|
|
5208
|
+
"basic functionality": {
|
|
5209
|
+
android: "11.9.0",
|
|
5210
|
+
ios: "11.9.0"
|
|
5000
5211
|
}
|
|
5001
5212
|
}
|
|
5002
5213
|
},
|
|
5003
|
-
|
|
5214
|
+
"center-thinning": {
|
|
5004
5215
|
type: "number",
|
|
5005
5216
|
"property-type": "data-constant",
|
|
5006
5217
|
"default": 1,
|
|
@@ -5019,8 +5230,8 @@
|
|
|
5019
5230
|
doc: "Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5020
5231
|
"sdk-support": {
|
|
5021
5232
|
"basic functionality": {
|
|
5022
|
-
android: "11.
|
|
5023
|
-
ios: "11.
|
|
5233
|
+
android: "11.9.0",
|
|
5234
|
+
ios: "11.9.0"
|
|
5024
5235
|
}
|
|
5025
5236
|
}
|
|
5026
5237
|
},
|
|
@@ -5045,15 +5256,39 @@
|
|
|
5045
5256
|
],
|
|
5046
5257
|
relaxZoomRestriction: true
|
|
5047
5258
|
},
|
|
5048
|
-
doc: "Main snow particles direction.
|
|
5259
|
+
doc: "Main snow particles direction. Azimuth and polar angles",
|
|
5049
5260
|
example: [
|
|
5050
5261
|
0,
|
|
5051
5262
|
45
|
|
5052
5263
|
],
|
|
5053
5264
|
"sdk-support": {
|
|
5054
5265
|
"basic functionality": {
|
|
5055
|
-
android: "11.
|
|
5056
|
-
ios: "11.
|
|
5266
|
+
android: "11.9.0",
|
|
5267
|
+
ios: "11.9.0"
|
|
5268
|
+
}
|
|
5269
|
+
}
|
|
5270
|
+
},
|
|
5271
|
+
"flake-size": {
|
|
5272
|
+
type: "number",
|
|
5273
|
+
"property-type": "data-constant",
|
|
5274
|
+
"default": 1,
|
|
5275
|
+
minimum: 0,
|
|
5276
|
+
maximum: 5,
|
|
5277
|
+
experimental: true,
|
|
5278
|
+
expression: {
|
|
5279
|
+
interpolated: true,
|
|
5280
|
+
parameters: [
|
|
5281
|
+
"zoom",
|
|
5282
|
+
"measure-light"
|
|
5283
|
+
],
|
|
5284
|
+
relaxZoomRestriction: true
|
|
5285
|
+
},
|
|
5286
|
+
transition: true,
|
|
5287
|
+
doc: "Snow flake particle size. Correlates with individual particle screen size",
|
|
5288
|
+
"sdk-support": {
|
|
5289
|
+
"basic functionality": {
|
|
5290
|
+
android: "11.9.0",
|
|
5291
|
+
ios: "11.9.0"
|
|
5057
5292
|
}
|
|
5058
5293
|
}
|
|
5059
5294
|
}
|
|
@@ -5075,11 +5310,11 @@
|
|
|
5075
5310
|
relaxZoomRestriction: true
|
|
5076
5311
|
},
|
|
5077
5312
|
transition: true,
|
|
5078
|
-
doc: "Rain particles density.",
|
|
5313
|
+
doc: "Rain particles density. Controls the overall screen density of the rain.",
|
|
5079
5314
|
"sdk-support": {
|
|
5080
5315
|
"basic functionality": {
|
|
5081
|
-
android: "11.
|
|
5082
|
-
ios: "11.
|
|
5316
|
+
android: "11.9.0",
|
|
5317
|
+
ios: "11.9.0"
|
|
5083
5318
|
}
|
|
5084
5319
|
}
|
|
5085
5320
|
},
|
|
@@ -5099,18 +5334,18 @@
|
|
|
5099
5334
|
relaxZoomRestriction: true
|
|
5100
5335
|
},
|
|
5101
5336
|
transition: true,
|
|
5102
|
-
doc: "Rain particles movement factor.",
|
|
5337
|
+
doc: "Rain particles movement factor. Controls the overall rain particles speed",
|
|
5103
5338
|
"sdk-support": {
|
|
5104
5339
|
"basic functionality": {
|
|
5105
|
-
android: "11.
|
|
5106
|
-
ios: "11.
|
|
5340
|
+
android: "11.9.0",
|
|
5341
|
+
ios: "11.9.0"
|
|
5107
5342
|
}
|
|
5108
5343
|
}
|
|
5109
5344
|
},
|
|
5110
5345
|
color: {
|
|
5111
5346
|
type: "color",
|
|
5112
5347
|
"property-type": "data-constant",
|
|
5113
|
-
"default": "#
|
|
5348
|
+
"default": "#919191",
|
|
5114
5349
|
experimental: true,
|
|
5115
5350
|
expression: {
|
|
5116
5351
|
interpolated: true,
|
|
@@ -5121,18 +5356,18 @@
|
|
|
5121
5356
|
relaxZoomRestriction: true
|
|
5122
5357
|
},
|
|
5123
5358
|
transition: true,
|
|
5124
|
-
doc: "",
|
|
5359
|
+
doc: "Individual rain particle dorplets color.",
|
|
5125
5360
|
"sdk-support": {
|
|
5126
5361
|
"basic functionality": {
|
|
5127
|
-
android: "11.
|
|
5128
|
-
ios: "11.
|
|
5362
|
+
android: "11.9.0",
|
|
5363
|
+
ios: "11.9.0"
|
|
5129
5364
|
}
|
|
5130
5365
|
}
|
|
5131
5366
|
},
|
|
5132
5367
|
opacity: {
|
|
5133
5368
|
type: "number",
|
|
5134
5369
|
"property-type": "data-constant",
|
|
5135
|
-
"default":
|
|
5370
|
+
"default": 0.19,
|
|
5136
5371
|
minimum: 0,
|
|
5137
5372
|
maximum: 1,
|
|
5138
5373
|
experimental: true,
|
|
@@ -5148,15 +5383,15 @@
|
|
|
5148
5383
|
doc: "Rain particles opacity.",
|
|
5149
5384
|
"sdk-support": {
|
|
5150
5385
|
"basic functionality": {
|
|
5151
|
-
android: "11.
|
|
5152
|
-
ios: "11.
|
|
5386
|
+
android: "11.9.0",
|
|
5387
|
+
ios: "11.9.0"
|
|
5153
5388
|
}
|
|
5154
5389
|
}
|
|
5155
5390
|
},
|
|
5156
5391
|
vignette: {
|
|
5157
5392
|
type: "number",
|
|
5158
5393
|
"property-type": "data-constant",
|
|
5159
|
-
"default": 0,
|
|
5394
|
+
"default": 0.3,
|
|
5160
5395
|
minimum: 0,
|
|
5161
5396
|
maximum: 1,
|
|
5162
5397
|
experimental: true,
|
|
@@ -5169,15 +5404,37 @@
|
|
|
5169
5404
|
relaxZoomRestriction: true
|
|
5170
5405
|
},
|
|
5171
5406
|
transition: true,
|
|
5172
|
-
doc: "
|
|
5407
|
+
doc: "Screen-space vignette rain tinting effect intensity.",
|
|
5173
5408
|
"sdk-support": {
|
|
5174
5409
|
"basic functionality": {
|
|
5175
|
-
android: "11.
|
|
5176
|
-
ios: "11.
|
|
5410
|
+
android: "11.9.0",
|
|
5411
|
+
ios: "11.9.0"
|
|
5412
|
+
}
|
|
5413
|
+
}
|
|
5414
|
+
},
|
|
5415
|
+
"vignette-color": {
|
|
5416
|
+
type: "color",
|
|
5417
|
+
"property-type": "data-constant",
|
|
5418
|
+
"default": "#ffffff",
|
|
5419
|
+
experimental: true,
|
|
5420
|
+
expression: {
|
|
5421
|
+
interpolated: true,
|
|
5422
|
+
parameters: [
|
|
5423
|
+
"zoom",
|
|
5424
|
+
"measure-light"
|
|
5425
|
+
],
|
|
5426
|
+
relaxZoomRestriction: true
|
|
5427
|
+
},
|
|
5428
|
+
transition: true,
|
|
5429
|
+
doc: "Rain vignette screen-space corners tint color.",
|
|
5430
|
+
"sdk-support": {
|
|
5431
|
+
"basic functionality": {
|
|
5432
|
+
android: "11.9.0",
|
|
5433
|
+
ios: "11.9.0"
|
|
5177
5434
|
}
|
|
5178
5435
|
}
|
|
5179
5436
|
},
|
|
5180
|
-
|
|
5437
|
+
"center-thinning": {
|
|
5181
5438
|
type: "number",
|
|
5182
5439
|
"property-type": "data-constant",
|
|
5183
5440
|
"default": 1,
|
|
@@ -5196,8 +5453,8 @@
|
|
|
5196
5453
|
doc: "Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5197
5454
|
"sdk-support": {
|
|
5198
5455
|
"basic functionality": {
|
|
5199
|
-
android: "11.
|
|
5200
|
-
ios: "11.
|
|
5456
|
+
android: "11.9.0",
|
|
5457
|
+
ios: "11.9.0"
|
|
5201
5458
|
}
|
|
5202
5459
|
}
|
|
5203
5460
|
},
|
|
@@ -5222,15 +5479,72 @@
|
|
|
5222
5479
|
],
|
|
5223
5480
|
relaxZoomRestriction: true
|
|
5224
5481
|
},
|
|
5225
|
-
doc: "Main rain particles direction.
|
|
5482
|
+
doc: "Main rain particles direction. Azimuth and polar angles.",
|
|
5226
5483
|
example: [
|
|
5227
5484
|
0,
|
|
5228
5485
|
45
|
|
5229
5486
|
],
|
|
5230
5487
|
"sdk-support": {
|
|
5231
5488
|
"basic functionality": {
|
|
5232
|
-
android: "11.
|
|
5233
|
-
ios: "11.
|
|
5489
|
+
android: "11.9.0",
|
|
5490
|
+
ios: "11.9.0"
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
},
|
|
5494
|
+
"droplet-size": {
|
|
5495
|
+
type: "array",
|
|
5496
|
+
"default": [
|
|
5497
|
+
1,
|
|
5498
|
+
10
|
|
5499
|
+
],
|
|
5500
|
+
minimum: 0,
|
|
5501
|
+
maximum: 20,
|
|
5502
|
+
length: 2,
|
|
5503
|
+
value: "number",
|
|
5504
|
+
"property-type": "data-constant",
|
|
5505
|
+
transition: true,
|
|
5506
|
+
experimental: true,
|
|
5507
|
+
expression: {
|
|
5508
|
+
interpolated: true,
|
|
5509
|
+
parameters: [
|
|
5510
|
+
"zoom",
|
|
5511
|
+
"measure-light"
|
|
5512
|
+
],
|
|
5513
|
+
relaxZoomRestriction: true
|
|
5514
|
+
},
|
|
5515
|
+
doc: "Rain droplet size. x - normal to direction, y - along direction",
|
|
5516
|
+
example: [
|
|
5517
|
+
0,
|
|
5518
|
+
45
|
|
5519
|
+
],
|
|
5520
|
+
"sdk-support": {
|
|
5521
|
+
"basic functionality": {
|
|
5522
|
+
android: "11.9.0",
|
|
5523
|
+
ios: "11.9.0"
|
|
5524
|
+
}
|
|
5525
|
+
}
|
|
5526
|
+
},
|
|
5527
|
+
"distortion-strength": {
|
|
5528
|
+
type: "number",
|
|
5529
|
+
"property-type": "data-constant",
|
|
5530
|
+
"default": 0.5,
|
|
5531
|
+
minimum: 0,
|
|
5532
|
+
maximum: 1,
|
|
5533
|
+
experimental: true,
|
|
5534
|
+
expression: {
|
|
5535
|
+
interpolated: true,
|
|
5536
|
+
parameters: [
|
|
5537
|
+
"zoom",
|
|
5538
|
+
"measure-light"
|
|
5539
|
+
],
|
|
5540
|
+
relaxZoomRestriction: true
|
|
5541
|
+
},
|
|
5542
|
+
transition: true,
|
|
5543
|
+
doc: "Rain particles screen-space distortion strength.",
|
|
5544
|
+
"sdk-support": {
|
|
5545
|
+
"basic functionality": {
|
|
5546
|
+
android: "11.9.0",
|
|
5547
|
+
ios: "11.9.0"
|
|
5234
5548
|
}
|
|
5235
5549
|
}
|
|
5236
5550
|
}
|
|
@@ -5268,7 +5582,29 @@
|
|
|
5268
5582
|
var colorTheme = {
|
|
5269
5583
|
data: {
|
|
5270
5584
|
type: "string",
|
|
5271
|
-
doc: "Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.",
|
|
5585
|
+
doc: "Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.",
|
|
5586
|
+
transition: false,
|
|
5587
|
+
"property-type": "data-constant",
|
|
5588
|
+
expression: {
|
|
5589
|
+
interpolated: false
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
};
|
|
5593
|
+
var indoor = {
|
|
5594
|
+
floorplanFeaturesetId: {
|
|
5595
|
+
type: "string",
|
|
5596
|
+
doc: "An ID of a featureset to be used to query indoor floorplans.",
|
|
5597
|
+
experimental: true,
|
|
5598
|
+
transition: false,
|
|
5599
|
+
"property-type": "data-constant",
|
|
5600
|
+
expression: {
|
|
5601
|
+
interpolated: false
|
|
5602
|
+
}
|
|
5603
|
+
},
|
|
5604
|
+
buildingFeaturesetId: {
|
|
5605
|
+
type: "string",
|
|
5606
|
+
doc: "An ID of a featureset to be used to add interactivity for building selection.",
|
|
5607
|
+
experimental: true,
|
|
5272
5608
|
transition: false,
|
|
5273
5609
|
"property-type": "data-constant",
|
|
5274
5610
|
expression: {
|
|
@@ -5935,7 +6271,8 @@
|
|
|
5935
6271
|
"zoom",
|
|
5936
6272
|
"feature",
|
|
5937
6273
|
"feature-state",
|
|
5938
|
-
"measure-light"
|
|
6274
|
+
"measure-light",
|
|
6275
|
+
"line-progress"
|
|
5939
6276
|
]
|
|
5940
6277
|
},
|
|
5941
6278
|
"property-type": "data-driven"
|
|
@@ -7552,34 +7889,6 @@
|
|
|
7552
7889
|
]
|
|
7553
7890
|
},
|
|
7554
7891
|
"property-type": "data-driven"
|
|
7555
|
-
},
|
|
7556
|
-
"symbol-elevation-reference": {
|
|
7557
|
-
type: "enum",
|
|
7558
|
-
doc: "Selects the base of symbol-elevation.",
|
|
7559
|
-
values: {
|
|
7560
|
-
sea: {
|
|
7561
|
-
doc: "Elevate symbols relative to the sea level."
|
|
7562
|
-
},
|
|
7563
|
-
ground: {
|
|
7564
|
-
doc: "Elevate symbols relative to the ground's height below them."
|
|
7565
|
-
}
|
|
7566
|
-
},
|
|
7567
|
-
"default": "ground",
|
|
7568
|
-
experimental: true,
|
|
7569
|
-
"sdk-support": {
|
|
7570
|
-
"basic functionality": {
|
|
7571
|
-
js: "3.7.0",
|
|
7572
|
-
android: "11.7.0",
|
|
7573
|
-
ios: "11.7.0"
|
|
7574
|
-
}
|
|
7575
|
-
},
|
|
7576
|
-
expression: {
|
|
7577
|
-
interpolated: false,
|
|
7578
|
-
parameters: [
|
|
7579
|
-
"zoom"
|
|
7580
|
-
]
|
|
7581
|
-
},
|
|
7582
|
-
"property-type": "data-constant"
|
|
7583
7892
|
}
|
|
7584
7893
|
};
|
|
7585
7894
|
var paint_raster = {
|
|
@@ -8089,7 +8398,7 @@
|
|
|
8089
8398
|
doc: "The background is aligned to the plane of the map."
|
|
8090
8399
|
},
|
|
8091
8400
|
viewport: {
|
|
8092
|
-
doc: "The background is aligned to the plane of the viewport, covering the whole screen."
|
|
8401
|
+
doc: "The background is aligned to the plane of the viewport, covering the whole screen. Note: This mode disables the automatic reordering of the layer when terrain or globe projection is used."
|
|
8093
8402
|
}
|
|
8094
8403
|
},
|
|
8095
8404
|
"default": "map",
|
|
@@ -8106,6 +8415,7 @@
|
|
|
8106
8415
|
parameters: [
|
|
8107
8416
|
]
|
|
8108
8417
|
},
|
|
8418
|
+
experimental: true,
|
|
8109
8419
|
"property-type": "data-constant"
|
|
8110
8420
|
},
|
|
8111
8421
|
"background-color": {
|
|
@@ -8457,11 +8767,13 @@
|
|
|
8457
8767
|
"default": 1,
|
|
8458
8768
|
minimum: 0,
|
|
8459
8769
|
maximum: 1,
|
|
8460
|
-
doc: "The opacity of the model layer.",
|
|
8770
|
+
doc: "The opacity of the model layer. Except for zoom, expressions that are data-driven are not supported if using GeoJSON or vector tile as the model layer source.",
|
|
8461
8771
|
transition: true,
|
|
8462
8772
|
expression: {
|
|
8463
8773
|
interpolated: true,
|
|
8464
8774
|
parameters: [
|
|
8775
|
+
"feature",
|
|
8776
|
+
"feature-state",
|
|
8465
8777
|
"zoom"
|
|
8466
8778
|
]
|
|
8467
8779
|
},
|
|
@@ -8470,9 +8782,14 @@
|
|
|
8470
8782
|
js: "3.0.0",
|
|
8471
8783
|
android: "11.0.0",
|
|
8472
8784
|
ios: "11.0.0"
|
|
8785
|
+
},
|
|
8786
|
+
"data-driven styling": {
|
|
8787
|
+
js: "3.9.0",
|
|
8788
|
+
android: "11.9.0",
|
|
8789
|
+
ios: "11.9.0"
|
|
8473
8790
|
}
|
|
8474
8791
|
},
|
|
8475
|
-
"property-type": "data-
|
|
8792
|
+
"property-type": "data-driven"
|
|
8476
8793
|
},
|
|
8477
8794
|
"model-rotation": {
|
|
8478
8795
|
type: "array",
|
|
@@ -8899,6 +9216,11 @@
|
|
|
8899
9216
|
data: {
|
|
8900
9217
|
type: "$root",
|
|
8901
9218
|
doc: "The inlined style that must correspond to the contents of the specified URL."
|
|
9219
|
+
},
|
|
9220
|
+
"color-theme": {
|
|
9221
|
+
type: "colorTheme",
|
|
9222
|
+
optional: true,
|
|
9223
|
+
doc: "If specified, it overrides the color-theme of the imported style."
|
|
8902
9224
|
}
|
|
8903
9225
|
},
|
|
8904
9226
|
config: config,
|
|
@@ -9068,6 +9390,24 @@
|
|
|
9068
9390
|
filter: filter,
|
|
9069
9391
|
filter_symbol: filter_symbol,
|
|
9070
9392
|
filter_fill: filter_fill,
|
|
9393
|
+
filter_hillshade: filter_hillshade,
|
|
9394
|
+
filter_raster: filter_raster,
|
|
9395
|
+
"filter_raster-particle": {
|
|
9396
|
+
type: "boolean",
|
|
9397
|
+
doc: "Expression which determines whether or not to enable the raster particle layer. Raster particle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
|
|
9398
|
+
"default": false,
|
|
9399
|
+
transition: false,
|
|
9400
|
+
"property-type": "data-driven",
|
|
9401
|
+
expression: {
|
|
9402
|
+
interpolated: false,
|
|
9403
|
+
parameters: [
|
|
9404
|
+
"zoom",
|
|
9405
|
+
"feature"
|
|
9406
|
+
]
|
|
9407
|
+
}
|
|
9408
|
+
},
|
|
9409
|
+
filter_clip: filter_clip,
|
|
9410
|
+
filter_model: filter_model,
|
|
9071
9411
|
filter_line: filter_line,
|
|
9072
9412
|
filter_circle: filter_circle,
|
|
9073
9413
|
"filter_fill-extrusion": {
|
|
@@ -9157,6 +9497,7 @@
|
|
|
9157
9497
|
rain: rain,
|
|
9158
9498
|
camera: camera,
|
|
9159
9499
|
colorTheme: colorTheme,
|
|
9500
|
+
indoor: indoor,
|
|
9160
9501
|
light: light,
|
|
9161
9502
|
projection: projection,
|
|
9162
9503
|
terrain: terrain,
|
|
@@ -11552,7 +11893,7 @@
|
|
|
11552
11893
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
11553
11894
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
11554
11895
|
*/
|
|
11555
|
-
|
|
11896
|
+
toStringPremultipliedAlpha() {
|
|
11556
11897
|
const [r, g, b, a] = this.a === 0 ? [
|
|
11557
11898
|
0,
|
|
11558
11899
|
0,
|
|
@@ -11566,10 +11907,22 @@
|
|
|
11566
11907
|
];
|
|
11567
11908
|
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
11568
11909
|
}
|
|
11910
|
+
toString() {
|
|
11911
|
+
const [r, g, b, a] = [
|
|
11912
|
+
this.r,
|
|
11913
|
+
this.g,
|
|
11914
|
+
this.b,
|
|
11915
|
+
this.a
|
|
11916
|
+
];
|
|
11917
|
+
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
11918
|
+
}
|
|
11569
11919
|
toRenderColor(lut) {
|
|
11570
11920
|
const {r, g, b, a} = this;
|
|
11571
11921
|
return new RenderColor(lut, r, g, b, a);
|
|
11572
11922
|
}
|
|
11923
|
+
clone() {
|
|
11924
|
+
return new Color(this.r, this.g, this.b, this.a);
|
|
11925
|
+
}
|
|
11573
11926
|
}
|
|
11574
11927
|
class RenderColor {
|
|
11575
11928
|
constructor(lut, r, g, b, a) {
|
|
@@ -11631,6 +11984,53 @@
|
|
|
11631
11984
|
];
|
|
11632
11985
|
}
|
|
11633
11986
|
/**
|
|
11987
|
+
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
11988
|
+
*
|
|
11989
|
+
* @returns An array of HSLA color values.
|
|
11990
|
+
*/
|
|
11991
|
+
toHslaArray() {
|
|
11992
|
+
if (this.a === 0) {
|
|
11993
|
+
return [
|
|
11994
|
+
0,
|
|
11995
|
+
0,
|
|
11996
|
+
0,
|
|
11997
|
+
0
|
|
11998
|
+
];
|
|
11999
|
+
}
|
|
12000
|
+
const {r, g, b, a} = this;
|
|
12001
|
+
const red = Math.min(Math.max(r / a, 0), 1);
|
|
12002
|
+
const green = Math.min(Math.max(g / a, 0), 1);
|
|
12003
|
+
const blue = Math.min(Math.max(b / a, 0), 1);
|
|
12004
|
+
const min = Math.min(red, green, blue);
|
|
12005
|
+
const max = Math.max(red, green, blue);
|
|
12006
|
+
const l = (min + max) / 2;
|
|
12007
|
+
if (min === max) {
|
|
12008
|
+
return [
|
|
12009
|
+
0,
|
|
12010
|
+
0,
|
|
12011
|
+
l * 100,
|
|
12012
|
+
a
|
|
12013
|
+
];
|
|
12014
|
+
}
|
|
12015
|
+
const delta = max - min;
|
|
12016
|
+
const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
12017
|
+
let h = 0;
|
|
12018
|
+
if (max === red) {
|
|
12019
|
+
h = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
12020
|
+
} else if (max === green) {
|
|
12021
|
+
h = (blue - red) / delta + 2;
|
|
12022
|
+
} else if (max === blue) {
|
|
12023
|
+
h = (red - green) / delta + 4;
|
|
12024
|
+
}
|
|
12025
|
+
h *= 60;
|
|
12026
|
+
return [
|
|
12027
|
+
Math.min(Math.max(h, 0), 360),
|
|
12028
|
+
Math.min(Math.max(s * 100, 0), 100),
|
|
12029
|
+
Math.min(Math.max(l * 100, 0), 100),
|
|
12030
|
+
a
|
|
12031
|
+
];
|
|
12032
|
+
}
|
|
12033
|
+
/**
|
|
11634
12034
|
* Returns a RGBA array of float values representing the color, unpremultiplied by A.
|
|
11635
12035
|
*
|
|
11636
12036
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
@@ -11747,7 +12147,7 @@
|
|
|
11747
12147
|
isEmpty() {
|
|
11748
12148
|
if (this.sections.length === 0)
|
|
11749
12149
|
return true;
|
|
11750
|
-
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary
|
|
12150
|
+
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary);
|
|
11751
12151
|
}
|
|
11752
12152
|
static factory(text) {
|
|
11753
12153
|
if (text instanceof Formatted) {
|
|
@@ -11791,42 +12191,113 @@
|
|
|
11791
12191
|
}
|
|
11792
12192
|
}
|
|
11793
12193
|
|
|
12194
|
+
class ImageIdWithOptions {
|
|
12195
|
+
constructor(id, options) {
|
|
12196
|
+
this.id = id;
|
|
12197
|
+
this.options = options || { params: {} };
|
|
12198
|
+
if (!this.options.transform) {
|
|
12199
|
+
this.options.transform = new DOMMatrix([
|
|
12200
|
+
1,
|
|
12201
|
+
0,
|
|
12202
|
+
0,
|
|
12203
|
+
1,
|
|
12204
|
+
0,
|
|
12205
|
+
0
|
|
12206
|
+
]);
|
|
12207
|
+
} else {
|
|
12208
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12209
|
+
this.options.transform = new DOMMatrix([
|
|
12210
|
+
a,
|
|
12211
|
+
b,
|
|
12212
|
+
c,
|
|
12213
|
+
d,
|
|
12214
|
+
e,
|
|
12215
|
+
f
|
|
12216
|
+
]);
|
|
12217
|
+
}
|
|
12218
|
+
}
|
|
12219
|
+
static deserializeFromString(serialized) {
|
|
12220
|
+
const deserializedObject = JSON.parse(serialized);
|
|
12221
|
+
({ params: deserializedObject.options.params });
|
|
12222
|
+
const {a, b, c, d, e, f} = deserializedObject.options.transform;
|
|
12223
|
+
new DOMMatrix([
|
|
12224
|
+
a,
|
|
12225
|
+
b,
|
|
12226
|
+
c,
|
|
12227
|
+
d,
|
|
12228
|
+
e,
|
|
12229
|
+
f
|
|
12230
|
+
]);
|
|
12231
|
+
return new ImageIdWithOptions(deserializedObject.id, deserializedObject.options);
|
|
12232
|
+
}
|
|
12233
|
+
scaleSelf(factor) {
|
|
12234
|
+
this.options.transform = this.options.transform.scale(factor);
|
|
12235
|
+
return this;
|
|
12236
|
+
}
|
|
12237
|
+
serialize() {
|
|
12238
|
+
const serialisedObject = { id: this.id };
|
|
12239
|
+
if (this.options) {
|
|
12240
|
+
serialisedObject.options = this.options;
|
|
12241
|
+
}
|
|
12242
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12243
|
+
serialisedObject.options.transform = {
|
|
12244
|
+
a,
|
|
12245
|
+
b,
|
|
12246
|
+
c,
|
|
12247
|
+
d,
|
|
12248
|
+
e,
|
|
12249
|
+
f
|
|
12250
|
+
};
|
|
12251
|
+
return JSON.stringify(serialisedObject);
|
|
12252
|
+
}
|
|
12253
|
+
}
|
|
12254
|
+
|
|
11794
12255
|
class ResolvedImage {
|
|
11795
12256
|
constructor(options) {
|
|
11796
12257
|
this.namePrimary = options.namePrimary;
|
|
11797
12258
|
if (options.nameSecondary) {
|
|
11798
12259
|
this.nameSecondary = options.nameSecondary;
|
|
11799
12260
|
}
|
|
12261
|
+
if (options.optionsPrimary) {
|
|
12262
|
+
this.optionsPrimary = options.optionsPrimary;
|
|
12263
|
+
}
|
|
12264
|
+
if (options.optionsSecondary) {
|
|
12265
|
+
this.optionsSecondary = options.optionsSecondary;
|
|
12266
|
+
}
|
|
11800
12267
|
this.available = options.available;
|
|
11801
12268
|
}
|
|
11802
12269
|
toString() {
|
|
11803
|
-
if (this.nameSecondary) {
|
|
12270
|
+
if (this.namePrimary && this.nameSecondary) {
|
|
11804
12271
|
return `[${ this.namePrimary },${ this.nameSecondary }]`;
|
|
11805
12272
|
}
|
|
11806
12273
|
return this.namePrimary;
|
|
11807
12274
|
}
|
|
11808
|
-
|
|
12275
|
+
getPrimary() {
|
|
12276
|
+
return new ImageIdWithOptions(this.namePrimary, { params: this.optionsPrimary ? this.optionsPrimary.params || {} : {} });
|
|
12277
|
+
}
|
|
12278
|
+
getSerializedPrimary() {
|
|
12279
|
+
return this.getPrimary().serialize();
|
|
12280
|
+
}
|
|
12281
|
+
getSecondary() {
|
|
12282
|
+
if (this.nameSecondary) {
|
|
12283
|
+
return new ImageIdWithOptions(this.nameSecondary, { params: this.optionsSecondary ? this.optionsSecondary.params || {} : {} });
|
|
12284
|
+
}
|
|
12285
|
+
return null;
|
|
12286
|
+
}
|
|
12287
|
+
static from(image) {
|
|
12288
|
+
return typeof image === 'string' ? ResolvedImage.build(image) : image;
|
|
12289
|
+
}
|
|
12290
|
+
static build(namePrimary, nameSecondary, optionsPrimary, optionsSecondary) {
|
|
11809
12291
|
if (!namePrimary)
|
|
11810
12292
|
return null;
|
|
11811
12293
|
return new ResolvedImage({
|
|
11812
12294
|
namePrimary,
|
|
11813
12295
|
nameSecondary,
|
|
12296
|
+
optionsPrimary,
|
|
12297
|
+
optionsSecondary,
|
|
11814
12298
|
available: false
|
|
11815
12299
|
});
|
|
11816
12300
|
}
|
|
11817
|
-
serialize() {
|
|
11818
|
-
if (this.nameSecondary) {
|
|
11819
|
-
return [
|
|
11820
|
-
'image',
|
|
11821
|
-
this.namePrimary,
|
|
11822
|
-
this.nameSecondary
|
|
11823
|
-
];
|
|
11824
|
-
}
|
|
11825
|
-
return [
|
|
11826
|
-
'image',
|
|
11827
|
-
this.namePrimary
|
|
11828
|
-
];
|
|
11829
|
-
}
|
|
11830
12301
|
}
|
|
11831
12302
|
|
|
11832
12303
|
function validateRGBA(r, g, b, a) {
|
|
@@ -11967,7 +12438,9 @@
|
|
|
11967
12438
|
return '';
|
|
11968
12439
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
11969
12440
|
return String(value);
|
|
11970
|
-
} else if (value instanceof Color
|
|
12441
|
+
} else if (value instanceof Color) {
|
|
12442
|
+
return value.toStringPremultipliedAlpha();
|
|
12443
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
11971
12444
|
return value.toString();
|
|
11972
12445
|
} else {
|
|
11973
12446
|
return JSON.stringify(value);
|
|
@@ -12216,29 +12689,114 @@
|
|
|
12216
12689
|
}
|
|
12217
12690
|
}
|
|
12218
12691
|
|
|
12692
|
+
function isImageOptions(value) {
|
|
12693
|
+
if (typeof value !== 'string' && !isExpression(value)) {
|
|
12694
|
+
return true;
|
|
12695
|
+
}
|
|
12696
|
+
return false;
|
|
12697
|
+
}
|
|
12219
12698
|
class ImageExpression {
|
|
12220
|
-
constructor(inputPrimary, inputSecondary) {
|
|
12699
|
+
constructor(inputPrimary, inputSecondary, inputPrimaryParams, inputSecondaryParams) {
|
|
12700
|
+
this._imageWarnHistory = {};
|
|
12221
12701
|
this.type = ResolvedImageType;
|
|
12222
12702
|
this.inputPrimary = inputPrimary;
|
|
12223
12703
|
this.inputSecondary = inputSecondary;
|
|
12704
|
+
this.inputPrimaryParams = inputPrimaryParams;
|
|
12705
|
+
this.inputSecondaryParams = inputSecondaryParams;
|
|
12224
12706
|
}
|
|
12225
12707
|
static parse(args, context) {
|
|
12226
12708
|
if (args.length < 2) {
|
|
12227
12709
|
return context.error(`Expected two or more arguments.`);
|
|
12228
12710
|
}
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12711
|
+
let nextArgId = 1;
|
|
12712
|
+
const imageExpression = [];
|
|
12713
|
+
function tryParseImage() {
|
|
12714
|
+
if (nextArgId < args.length) {
|
|
12715
|
+
const imageName = context.parse(args[nextArgId], nextArgId++, StringType);
|
|
12716
|
+
if (!imageName) {
|
|
12717
|
+
context.error(imageExpression.length ? `Secondary image variant is not a string.` : `No image name provided.`);
|
|
12718
|
+
return false;
|
|
12719
|
+
}
|
|
12720
|
+
imageExpression.push({
|
|
12721
|
+
image: imageName,
|
|
12722
|
+
options: void 0
|
|
12723
|
+
});
|
|
12724
|
+
return true;
|
|
12725
|
+
}
|
|
12726
|
+
return true;
|
|
12727
|
+
}
|
|
12728
|
+
function tryParseOptions() {
|
|
12729
|
+
if (nextArgId < args.length) {
|
|
12730
|
+
if (!isImageOptions(args[nextArgId])) {
|
|
12731
|
+
return true;
|
|
12732
|
+
}
|
|
12733
|
+
const params = args[nextArgId].params;
|
|
12734
|
+
const optionsContext = context.concat(nextArgId);
|
|
12735
|
+
if (!params) {
|
|
12736
|
+
nextArgId++;
|
|
12737
|
+
return true;
|
|
12738
|
+
}
|
|
12739
|
+
if (typeof params !== 'object' || params.constructor !== Object) {
|
|
12740
|
+
optionsContext.error(`Image options "params" should be an object`);
|
|
12741
|
+
return false;
|
|
12742
|
+
}
|
|
12743
|
+
const parsed = {};
|
|
12744
|
+
const childContext = optionsContext.concat(void 0, 'params');
|
|
12745
|
+
for (const key in params) {
|
|
12746
|
+
if (!key) {
|
|
12747
|
+
childContext.error(`Image parameter name should be non-empty`);
|
|
12748
|
+
return false;
|
|
12749
|
+
}
|
|
12750
|
+
const value = childContext.concat(void 0, key).parse(params[key], void 0, ColorType, void 0, { typeAnnotation: 'coerce' });
|
|
12751
|
+
if (!value) {
|
|
12752
|
+
return false;
|
|
12753
|
+
}
|
|
12754
|
+
parsed[key] = value;
|
|
12755
|
+
}
|
|
12756
|
+
imageExpression[imageExpression.length - 1].options = parsed;
|
|
12757
|
+
nextArgId++;
|
|
12758
|
+
return true;
|
|
12759
|
+
}
|
|
12760
|
+
return true;
|
|
12761
|
+
}
|
|
12762
|
+
for (let i = 0; i < 2; i++) {
|
|
12763
|
+
if (!tryParseImage() || !tryParseOptions()) {
|
|
12764
|
+
return;
|
|
12765
|
+
}
|
|
12766
|
+
}
|
|
12767
|
+
return new ImageExpression(imageExpression[0].image, imageExpression[1] ? imageExpression[1].image : void 0, imageExpression[0].options, imageExpression[1] ? imageExpression[1].options : void 0);
|
|
12768
|
+
}
|
|
12769
|
+
evaluateParams(ctx, params) {
|
|
12770
|
+
const result = {};
|
|
12771
|
+
if (params) {
|
|
12772
|
+
for (const key in params) {
|
|
12773
|
+
if (params[key]) {
|
|
12774
|
+
try {
|
|
12775
|
+
const color = params[key].evaluate(ctx);
|
|
12776
|
+
const msg = `Ignoring image parameter "${ key }" with semi-transparent color ${ color.toString() }`;
|
|
12777
|
+
if (color.a !== 1) {
|
|
12778
|
+
if (!this._imageWarnHistory[msg]) {
|
|
12779
|
+
console.warn(msg);
|
|
12780
|
+
this._imageWarnHistory[msg] = true;
|
|
12781
|
+
}
|
|
12782
|
+
continue;
|
|
12783
|
+
}
|
|
12784
|
+
result[key] = color;
|
|
12785
|
+
} catch (err) {
|
|
12786
|
+
continue;
|
|
12787
|
+
}
|
|
12788
|
+
}
|
|
12789
|
+
}
|
|
12790
|
+
} else {
|
|
12791
|
+
return void 0;
|
|
12792
|
+
}
|
|
12793
|
+
if (Object.keys(result).length === 0) {
|
|
12794
|
+
return void 0;
|
|
12234
12795
|
}
|
|
12235
|
-
|
|
12236
|
-
if (!nameSecondary)
|
|
12237
|
-
return context.error(`Secondary image variant is not a string.`);
|
|
12238
|
-
return new ImageExpression(namePrimary, nameSecondary);
|
|
12796
|
+
return { params: result };
|
|
12239
12797
|
}
|
|
12240
12798
|
evaluate(ctx) {
|
|
12241
|
-
const value = ResolvedImage.
|
|
12799
|
+
const value = ResolvedImage.build(this.inputPrimary.evaluate(ctx), this.inputSecondary ? this.inputSecondary.evaluate(ctx) : void 0, this.inputPrimaryParams ? this.evaluateParams(ctx, this.inputPrimaryParams) : void 0, this.inputSecondaryParams ? this.evaluateParams(ctx, this.inputSecondaryParams) : void 0);
|
|
12242
12800
|
if (value && ctx.availableImages) {
|
|
12243
12801
|
value.available = ctx.availableImages.indexOf(value.namePrimary) > -1;
|
|
12244
12802
|
if (value.nameSecondary && value.available && ctx.availableImages) {
|
|
@@ -12249,25 +12807,55 @@
|
|
|
12249
12807
|
}
|
|
12250
12808
|
eachChild(fn) {
|
|
12251
12809
|
fn(this.inputPrimary);
|
|
12810
|
+
if (this.inputPrimaryParams) {
|
|
12811
|
+
for (const key in this.inputPrimaryParams) {
|
|
12812
|
+
if (this.inputPrimaryParams[key]) {
|
|
12813
|
+
fn(this.inputPrimaryParams[key]);
|
|
12814
|
+
}
|
|
12815
|
+
}
|
|
12816
|
+
}
|
|
12252
12817
|
if (this.inputSecondary) {
|
|
12253
12818
|
fn(this.inputSecondary);
|
|
12819
|
+
if (this.inputSecondaryParams) {
|
|
12820
|
+
for (const key in this.inputSecondaryParams) {
|
|
12821
|
+
if (this.inputSecondaryParams[key]) {
|
|
12822
|
+
fn(this.inputSecondaryParams[key]);
|
|
12823
|
+
}
|
|
12824
|
+
}
|
|
12825
|
+
}
|
|
12254
12826
|
}
|
|
12255
12827
|
}
|
|
12256
12828
|
outputDefined() {
|
|
12257
12829
|
return false;
|
|
12258
12830
|
}
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12831
|
+
serializeParams(params) {
|
|
12832
|
+
const result = {};
|
|
12833
|
+
if (params) {
|
|
12834
|
+
for (const key in params) {
|
|
12835
|
+
if (params[key]) {
|
|
12836
|
+
result[key] = params[key].serialize();
|
|
12837
|
+
}
|
|
12838
|
+
}
|
|
12839
|
+
} else {
|
|
12840
|
+
return void 0;
|
|
12266
12841
|
}
|
|
12267
|
-
return
|
|
12842
|
+
return { params: result };
|
|
12843
|
+
}
|
|
12844
|
+
serialize() {
|
|
12845
|
+
const serialized = [
|
|
12268
12846
|
'image',
|
|
12269
12847
|
this.inputPrimary.serialize()
|
|
12270
12848
|
];
|
|
12849
|
+
if (this.inputPrimaryParams) {
|
|
12850
|
+
serialized.push(this.serializeParams(this.inputPrimaryParams));
|
|
12851
|
+
}
|
|
12852
|
+
if (this.inputSecondary) {
|
|
12853
|
+
serialized.push(this.inputSecondary.serialize());
|
|
12854
|
+
if (this.inputSecondaryParams) {
|
|
12855
|
+
serialized.push(this.serializeParams(this.inputSecondaryParams));
|
|
12856
|
+
}
|
|
12857
|
+
}
|
|
12858
|
+
return serialized;
|
|
12271
12859
|
}
|
|
12272
12860
|
}
|
|
12273
12861
|
|
|
@@ -12395,7 +12983,7 @@
|
|
|
12395
12983
|
} else if (this.type.kind === 'formatted') {
|
|
12396
12984
|
return Formatted.fromString(toString(this.args[0].evaluate(ctx)));
|
|
12397
12985
|
} else if (this.type.kind === 'resolvedImage') {
|
|
12398
|
-
return ResolvedImage.
|
|
12986
|
+
return ResolvedImage.build(toString(this.args[0].evaluate(ctx)));
|
|
12399
12987
|
} else if (this.type.kind === 'array') {
|
|
12400
12988
|
return this.args.map(arg => {
|
|
12401
12989
|
return arg.evaluate(ctx);
|
|
@@ -14149,7 +14737,7 @@
|
|
|
14149
14737
|
return Formatted.fromString(toString(value));
|
|
14150
14738
|
}
|
|
14151
14739
|
case 'resolvedImage': {
|
|
14152
|
-
return ResolvedImage.
|
|
14740
|
+
return ResolvedImage.build(toString(value));
|
|
14153
14741
|
}
|
|
14154
14742
|
}
|
|
14155
14743
|
return value;
|
|
@@ -14807,11 +15395,12 @@
|
|
|
14807
15395
|
});
|
|
14808
15396
|
|
|
14809
15397
|
class Interpolate {
|
|
14810
|
-
constructor(type, operator, interpolation, input, stops) {
|
|
15398
|
+
constructor(type, operator, interpolation, input, dynamicStops, stops) {
|
|
14811
15399
|
this.type = type;
|
|
14812
15400
|
this.operator = operator;
|
|
14813
15401
|
this.interpolation = interpolation;
|
|
14814
15402
|
this.input = input;
|
|
15403
|
+
this.dynamicStops = dynamicStops;
|
|
14815
15404
|
this.labels = [];
|
|
14816
15405
|
this.outputs = [];
|
|
14817
15406
|
for (const [label, expression] of stops) {
|
|
@@ -14859,10 +15448,10 @@
|
|
|
14859
15448
|
} else {
|
|
14860
15449
|
return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0);
|
|
14861
15450
|
}
|
|
14862
|
-
if (args.length - 1 <
|
|
14863
|
-
return context.error(`Expected at least
|
|
15451
|
+
if (args.length - 1 < 3) {
|
|
15452
|
+
return context.error(`Expected at least 3 arguments, but found only ${ args.length - 1 }.`);
|
|
14864
15453
|
}
|
|
14865
|
-
if ((args.length - 1) % 2 !== 0) {
|
|
15454
|
+
if (args.length - 1 > 3 && (args.length - 1) % 2 !== 0) {
|
|
14866
15455
|
return context.error(`Expected an even number of arguments.`);
|
|
14867
15456
|
}
|
|
14868
15457
|
input = context.parse(input, 2, NumberType);
|
|
@@ -14875,6 +15464,12 @@
|
|
|
14875
15464
|
} else if (context.expectedType && context.expectedType.kind !== 'value') {
|
|
14876
15465
|
outputType = context.expectedType;
|
|
14877
15466
|
}
|
|
15467
|
+
if (args.length - 1 === 3) {
|
|
15468
|
+
const dynamicStops = context.parse(rest[0], 3, ValueType);
|
|
15469
|
+
if (!dynamicStops)
|
|
15470
|
+
return null;
|
|
15471
|
+
return new Interpolate(outputType, operator, interpolation, input, dynamicStops, stops);
|
|
15472
|
+
}
|
|
14878
15473
|
for (let i = 0; i < rest.length; i += 2) {
|
|
14879
15474
|
const label = rest[i];
|
|
14880
15475
|
const value = rest[i + 1];
|
|
@@ -14898,11 +15493,34 @@
|
|
|
14898
15493
|
if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
|
|
14899
15494
|
return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`);
|
|
14900
15495
|
}
|
|
14901
|
-
return new Interpolate(outputType, operator, interpolation, input, stops);
|
|
15496
|
+
return new Interpolate(outputType, operator, interpolation, input, null, stops);
|
|
14902
15497
|
}
|
|
14903
15498
|
evaluate(ctx) {
|
|
14904
|
-
|
|
14905
|
-
|
|
15499
|
+
let labels = this.labels;
|
|
15500
|
+
let outputs = this.outputs;
|
|
15501
|
+
if (this.dynamicStops) {
|
|
15502
|
+
const dynamicStopsValue = this.dynamicStops.evaluate(ctx);
|
|
15503
|
+
if (dynamicStopsValue.length % 2 !== 0) {
|
|
15504
|
+
throw new RuntimeError('Expected an even number of arguments.');
|
|
15505
|
+
}
|
|
15506
|
+
labels = [];
|
|
15507
|
+
outputs = [];
|
|
15508
|
+
for (let i = 0; i < dynamicStopsValue.length; i += 2) {
|
|
15509
|
+
const label = dynamicStopsValue[i];
|
|
15510
|
+
const output = new Literal(NumberType, dynamicStopsValue[i + 1]);
|
|
15511
|
+
if (typeof label !== 'number') {
|
|
15512
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.');
|
|
15513
|
+
}
|
|
15514
|
+
if (labels.length && labels[labels.length - 1] >= label) {
|
|
15515
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');
|
|
15516
|
+
}
|
|
15517
|
+
labels.push(label);
|
|
15518
|
+
outputs.push(output);
|
|
15519
|
+
}
|
|
15520
|
+
if (labels.length === 0) {
|
|
15521
|
+
throw new RuntimeError('Expected at least one input/output pair.');
|
|
15522
|
+
}
|
|
15523
|
+
}
|
|
14906
15524
|
if (labels.length === 1) {
|
|
14907
15525
|
return outputs[0].evaluate(ctx);
|
|
14908
15526
|
}
|
|
@@ -14958,8 +15576,12 @@
|
|
|
14958
15576
|
interpolation,
|
|
14959
15577
|
this.input.serialize()
|
|
14960
15578
|
];
|
|
14961
|
-
|
|
14962
|
-
serialized.push(this.
|
|
15579
|
+
if (this.dynamicStops) {
|
|
15580
|
+
serialized.push(this.dynamicStops.serialize());
|
|
15581
|
+
} else {
|
|
15582
|
+
for (let i = 0; i < this.labels.length; i++) {
|
|
15583
|
+
serialized.push(this.labels[i], this.outputs[i].serialize());
|
|
15584
|
+
}
|
|
14963
15585
|
}
|
|
14964
15586
|
return serialized;
|
|
14965
15587
|
}
|
|
@@ -15947,6 +16569,13 @@
|
|
|
15947
16569
|
return v.evaluate(ctx).toRenderColor(null).toArray();
|
|
15948
16570
|
}
|
|
15949
16571
|
],
|
|
16572
|
+
'to-hsla': [
|
|
16573
|
+
array$1(NumberType, 4),
|
|
16574
|
+
[ColorType],
|
|
16575
|
+
(ctx, [v]) => {
|
|
16576
|
+
return v.evaluate(ctx).toRenderColor(null).toHslaArray();
|
|
16577
|
+
}
|
|
16578
|
+
],
|
|
15950
16579
|
'rgb': [
|
|
15951
16580
|
ColorType,
|
|
15952
16581
|
[
|
|
@@ -16522,6 +17151,9 @@
|
|
|
16522
17151
|
function supportsZoomExpression(spec) {
|
|
16523
17152
|
return expressionHasParameter(spec.expression, 'zoom');
|
|
16524
17153
|
}
|
|
17154
|
+
function supportsLineProgressExpression(spec) {
|
|
17155
|
+
return expressionHasParameter(spec.expression, 'line-progress');
|
|
17156
|
+
}
|
|
16525
17157
|
function supportsInterpolation(spec) {
|
|
16526
17158
|
return !!spec.expression && spec.expression.interpolated;
|
|
16527
17159
|
}
|
|
@@ -16708,7 +17340,7 @@
|
|
|
16708
17340
|
} else if (propertySpec.type === 'formatted') {
|
|
16709
17341
|
input = Formatted.fromString(input.toString());
|
|
16710
17342
|
} else if (propertySpec.type === 'resolvedImage') {
|
|
16711
|
-
input = ResolvedImage.
|
|
17343
|
+
input = ResolvedImage.build(input.toString());
|
|
16712
17344
|
} else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
|
|
16713
17345
|
input = void 0;
|
|
16714
17346
|
}
|
|
@@ -16733,6 +17365,7 @@
|
|
|
16733
17365
|
this._evaluator = new EvaluationContext(scope, options);
|
|
16734
17366
|
this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;
|
|
16735
17367
|
this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;
|
|
17368
|
+
this.configDependencies = getConfigDependencies(expression);
|
|
16736
17369
|
}
|
|
16737
17370
|
evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
|
|
16738
17371
|
this._evaluator.globals = globals;
|
|
@@ -16786,10 +17419,11 @@
|
|
|
16786
17419
|
return success(new StyleExpression(parsed, propertySpec, scope, options));
|
|
16787
17420
|
}
|
|
16788
17421
|
class ZoomConstantExpression {
|
|
16789
|
-
constructor(kind, expression, isLightConstant) {
|
|
17422
|
+
constructor(kind, expression, isLightConstant, isLineProgressConstant) {
|
|
16790
17423
|
this.kind = kind;
|
|
16791
17424
|
this._styleExpression = expression;
|
|
16792
17425
|
this.isLightConstant = isLightConstant;
|
|
17426
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16793
17427
|
this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
|
|
16794
17428
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16795
17429
|
}
|
|
@@ -16801,12 +17435,13 @@
|
|
|
16801
17435
|
}
|
|
16802
17436
|
}
|
|
16803
17437
|
class ZoomDependentExpression {
|
|
16804
|
-
constructor(kind, expression, zoomStops, interpolationType, isLightConstant) {
|
|
17438
|
+
constructor(kind, expression, zoomStops, interpolationType, isLightConstant, isLineProgressConstant) {
|
|
16805
17439
|
this.kind = kind;
|
|
16806
17440
|
this.zoomStops = zoomStops;
|
|
16807
17441
|
this._styleExpression = expression;
|
|
16808
17442
|
this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
|
|
16809
17443
|
this.isLightConstant = isLightConstant;
|
|
17444
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16810
17445
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16811
17446
|
this.interpolationType = interpolationType;
|
|
16812
17447
|
}
|
|
@@ -16846,6 +17481,10 @@
|
|
|
16846
17481
|
if (!isLightConstant && !supportsLightExpression(propertySpec)) {
|
|
16847
17482
|
return error([new ParsingError$1('', 'measure-light expression not supported')]);
|
|
16848
17483
|
}
|
|
17484
|
+
const isLineProgressConstant = isGlobalPropertyConstant(parsed, ['line-progress']);
|
|
17485
|
+
if (!isLineProgressConstant && !supportsLineProgressExpression(propertySpec)) {
|
|
17486
|
+
return error([new ParsingError$1('', 'line-progress expression not supported')]);
|
|
17487
|
+
}
|
|
16849
17488
|
const canRelaxZoomRestriction = propertySpec.expression && propertySpec.expression.relaxZoomRestriction;
|
|
16850
17489
|
const zoomCurve = findZoomCurve(parsed);
|
|
16851
17490
|
if (!zoomCurve && !isZoomConstant && !canRelaxZoomRestriction) {
|
|
@@ -16856,14 +17495,14 @@
|
|
|
16856
17495
|
return error([new ParsingError$1('', '"interpolate" expressions cannot be used with this property')]);
|
|
16857
17496
|
}
|
|
16858
17497
|
if (!zoomCurve) {
|
|
16859
|
-
return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16860
|
-
new ZoomConstantExpression('constant', expression.value, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16861
|
-
new ZoomConstantExpression('source', expression.value, isLightConstant));
|
|
17498
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17499
|
+
new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17500
|
+
new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
|
|
16862
17501
|
}
|
|
16863
17502
|
const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
|
|
16864
|
-
return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16865
|
-
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16866
|
-
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant));
|
|
17503
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17504
|
+
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17505
|
+
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
|
|
16867
17506
|
}
|
|
16868
17507
|
class StylePropertyFunction {
|
|
16869
17508
|
constructor(parameters, specification) {
|
|
@@ -17334,13 +17973,16 @@ Filter Expression:
|
|
|
17334
17973
|
${ JSON.stringify(filterExp, null, 2) }
|
|
17335
17974
|
`);
|
|
17336
17975
|
}
|
|
17337
|
-
const filterSpec = v8[`filter_${ layerType }`];
|
|
17338
|
-
const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
|
|
17339
17976
|
let filterFunc = null;
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17977
|
+
let filterSpec = null;
|
|
17978
|
+
if (layerType !== 'background' && layerType !== 'sky' && layerType !== 'slot') {
|
|
17979
|
+
filterSpec = v8[`filter_${ layerType }`];
|
|
17980
|
+
const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
|
|
17981
|
+
if (compiledStaticFilter.result === 'error') {
|
|
17982
|
+
throw new Error(compiledStaticFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', '));
|
|
17983
|
+
} else {
|
|
17984
|
+
filterFunc = (globalProperties, feature, canonical) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);
|
|
17985
|
+
}
|
|
17344
17986
|
}
|
|
17345
17987
|
let dynamicFilterFunc = null;
|
|
17346
17988
|
let needFeature = null;
|
|
@@ -17982,6 +18624,14 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
17982
18624
|
*/
|
|
17983
18625
|
setFog: 'setFog',
|
|
17984
18626
|
/*
|
|
18627
|
+
* { command: 'setSnow', args: [snowProperties] }
|
|
18628
|
+
*/
|
|
18629
|
+
setSnow: 'setSnow',
|
|
18630
|
+
/*
|
|
18631
|
+
* { command: 'setRain', args: [rainProperties] }
|
|
18632
|
+
*/
|
|
18633
|
+
setRain: 'setRain',
|
|
18634
|
+
/*
|
|
17985
18635
|
* { command: 'setCamera', args: [cameraProperties] }
|
|
17986
18636
|
*/
|
|
17987
18637
|
setCamera: 'setCamera',
|
|
@@ -18382,6 +19032,18 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
18382
19032
|
args: [after.fog]
|
|
18383
19033
|
});
|
|
18384
19034
|
}
|
|
19035
|
+
if (!deepEqual(before.snow, after.snow)) {
|
|
19036
|
+
commands.push({
|
|
19037
|
+
command: operations.setSnow,
|
|
19038
|
+
args: [after.snow]
|
|
19039
|
+
});
|
|
19040
|
+
}
|
|
19041
|
+
if (!deepEqual(before.rain, after.rain)) {
|
|
19042
|
+
commands.push({
|
|
19043
|
+
command: operations.setRain,
|
|
19044
|
+
args: [after.rain]
|
|
19045
|
+
});
|
|
19046
|
+
}
|
|
18385
19047
|
if (!deepEqual(before.projection, after.projection)) {
|
|
18386
19048
|
commands.push({
|
|
18387
19049
|
command: operations.setProjection,
|
|
@@ -18993,6 +19655,16 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
18993
19655
|
const layerSpec = styleSpec[`${ propertyType }_${ options.layerType }`];
|
|
18994
19656
|
if (!layerSpec)
|
|
18995
19657
|
return [];
|
|
19658
|
+
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
19659
|
+
if (propertyType === 'paint' && useThemeMatch && layerSpec[useThemeMatch[1]]) {
|
|
19660
|
+
return validate({
|
|
19661
|
+
key,
|
|
19662
|
+
value,
|
|
19663
|
+
valueSpec: { type: 'string' },
|
|
19664
|
+
style,
|
|
19665
|
+
styleSpec
|
|
19666
|
+
});
|
|
19667
|
+
}
|
|
18996
19668
|
const transitionMatch = propertyKey.match(/^(.*)-transition$/);
|
|
18997
19669
|
if (propertyType === 'paint' && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) {
|
|
18998
19670
|
return validate({
|
|
@@ -19367,7 +20039,16 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
19367
20039
|
}
|
|
19368
20040
|
for (const key in light) {
|
|
19369
20041
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19370
|
-
|
|
20042
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20043
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20044
|
+
errors = errors.concat(validate({
|
|
20045
|
+
key,
|
|
20046
|
+
value: light[key],
|
|
20047
|
+
valueSpec: { type: 'string' },
|
|
20048
|
+
style,
|
|
20049
|
+
styleSpec
|
|
20050
|
+
}));
|
|
20051
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19371
20052
|
errors = errors.concat(validate({
|
|
19372
20053
|
key,
|
|
19373
20054
|
value: light[key],
|
|
@@ -19453,7 +20134,16 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
19453
20134
|
}
|
|
19454
20135
|
} else {
|
|
19455
20136
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19456
|
-
|
|
20137
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20138
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20139
|
+
errors = errors.concat(validate({
|
|
20140
|
+
key: key2,
|
|
20141
|
+
value: light[key2],
|
|
20142
|
+
valueSpec: { type: 'string' },
|
|
20143
|
+
style,
|
|
20144
|
+
styleSpec
|
|
20145
|
+
}));
|
|
20146
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19457
20147
|
errors = errors.concat(validate({
|
|
19458
20148
|
key: key2,
|
|
19459
20149
|
value: light[key2],
|
|
@@ -19495,7 +20185,16 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
19495
20185
|
}
|
|
19496
20186
|
for (const key2 in terrain) {
|
|
19497
20187
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19498
|
-
|
|
20188
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20189
|
+
if (useThemeMatch && terrainSpec[useThemeMatch[1]]) {
|
|
20190
|
+
errors = errors.concat(validate({
|
|
20191
|
+
key: key2,
|
|
20192
|
+
value: terrain[key2],
|
|
20193
|
+
valueSpec: { type: 'string' },
|
|
20194
|
+
style,
|
|
20195
|
+
styleSpec
|
|
20196
|
+
}));
|
|
20197
|
+
} else if (transitionMatch && terrainSpec[transitionMatch[1]] && terrainSpec[transitionMatch[1]].transition) {
|
|
19499
20198
|
errors = errors.concat(validate({
|
|
19500
20199
|
key: key2,
|
|
19501
20200
|
value: terrain[key2],
|
|
@@ -19544,7 +20243,16 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
19544
20243
|
}
|
|
19545
20244
|
for (const key in fog) {
|
|
19546
20245
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19547
|
-
|
|
20246
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20247
|
+
if (useThemeMatch && fogSpec[useThemeMatch[1]]) {
|
|
20248
|
+
errors = errors.concat(validate({
|
|
20249
|
+
key,
|
|
20250
|
+
value: fog[key],
|
|
20251
|
+
valueSpec: { type: 'string' },
|
|
20252
|
+
style,
|
|
20253
|
+
styleSpec
|
|
20254
|
+
}));
|
|
20255
|
+
} else if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
|
|
19548
20256
|
errors = errors.concat(validate({
|
|
19549
20257
|
key,
|
|
19550
20258
|
value: fog[key],
|