@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.es.js
CHANGED
|
@@ -107,6 +107,16 @@ var $root = {
|
|
|
107
107
|
type: "fog",
|
|
108
108
|
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."
|
|
109
109
|
},
|
|
110
|
+
snow: {
|
|
111
|
+
type: "snow",
|
|
112
|
+
doc: "Global precipitation particle-based snow. Having snow present in the style forces constant map repaint mode",
|
|
113
|
+
experimental: true
|
|
114
|
+
},
|
|
115
|
+
rain: {
|
|
116
|
+
type: "rain",
|
|
117
|
+
doc: "Global precipitation particle-based rain effect. Having rain present in the style forces constant map repaint mode.",
|
|
118
|
+
experimental: true
|
|
119
|
+
},
|
|
110
120
|
camera: {
|
|
111
121
|
type: "camera",
|
|
112
122
|
doc: "Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."
|
|
@@ -115,6 +125,11 @@ var $root = {
|
|
|
115
125
|
type: "colorTheme",
|
|
116
126
|
doc: "A global modifier for the colors of the style."
|
|
117
127
|
},
|
|
128
|
+
indoor: {
|
|
129
|
+
type: "indoor",
|
|
130
|
+
experimental: true,
|
|
131
|
+
doc: "Controls the behaviour of indoor features."
|
|
132
|
+
},
|
|
118
133
|
imports: {
|
|
119
134
|
type: "array",
|
|
120
135
|
value: "import",
|
|
@@ -212,7 +227,7 @@ var $root = {
|
|
|
212
227
|
featuresets: {
|
|
213
228
|
experimental: true,
|
|
214
229
|
type: "featuresets",
|
|
215
|
-
doc: "Defines sets of features for querying, interaction, and
|
|
230
|
+
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.",
|
|
216
231
|
example: {
|
|
217
232
|
poi: {
|
|
218
233
|
selectors: [
|
|
@@ -455,6 +470,28 @@ var properties_light_directional = {
|
|
|
455
470
|
}
|
|
456
471
|
}
|
|
457
472
|
},
|
|
473
|
+
"shadow-quality": {
|
|
474
|
+
type: "number",
|
|
475
|
+
"property-type": "data-constant",
|
|
476
|
+
"default": 1,
|
|
477
|
+
minimum: 0,
|
|
478
|
+
maximum: 1,
|
|
479
|
+
expression: {
|
|
480
|
+
interpolated: false,
|
|
481
|
+
parameters: [
|
|
482
|
+
"zoom"
|
|
483
|
+
]
|
|
484
|
+
},
|
|
485
|
+
transition: false,
|
|
486
|
+
doc: "Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value.",
|
|
487
|
+
"sdk-support": {
|
|
488
|
+
"basic functionality": {
|
|
489
|
+
android: "11.9.0",
|
|
490
|
+
ios: "11.9.0"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
experimental: true
|
|
494
|
+
},
|
|
458
495
|
"shadow-intensity": {
|
|
459
496
|
type: "number",
|
|
460
497
|
"property-type": "data-constant",
|
|
@@ -1579,6 +1616,35 @@ var layout_fill = {
|
|
|
1579
1616
|
interpolated: false
|
|
1580
1617
|
},
|
|
1581
1618
|
"property-type": "constant"
|
|
1619
|
+
},
|
|
1620
|
+
"fill-elevation-reference": {
|
|
1621
|
+
type: "enum",
|
|
1622
|
+
doc: "Selects the base of fill-elevation. Some modes might require precomputed elevation data in the tileset.",
|
|
1623
|
+
values: {
|
|
1624
|
+
none: {
|
|
1625
|
+
doc: "Elevated rendering is disabled."
|
|
1626
|
+
},
|
|
1627
|
+
"hd-road-base": {
|
|
1628
|
+
doc: "Elevate geometry relative to HD roads. Use this mode to describe base polygons of the road networks."
|
|
1629
|
+
},
|
|
1630
|
+
"hd-road-markup": {
|
|
1631
|
+
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."
|
|
1632
|
+
}
|
|
1633
|
+
},
|
|
1634
|
+
"default": "none",
|
|
1635
|
+
experimental: true,
|
|
1636
|
+
"private": true,
|
|
1637
|
+
transition: false,
|
|
1638
|
+
"sdk-support": {
|
|
1639
|
+
"basic functionality": {
|
|
1640
|
+
android: "11.9.0",
|
|
1641
|
+
ios: "11.9.0"
|
|
1642
|
+
}
|
|
1643
|
+
},
|
|
1644
|
+
expression: {
|
|
1645
|
+
interpolated: false
|
|
1646
|
+
},
|
|
1647
|
+
"property-type": "data-constant"
|
|
1582
1648
|
}
|
|
1583
1649
|
};
|
|
1584
1650
|
var layout_circle = {
|
|
@@ -1927,6 +1993,36 @@ var layout_line = {
|
|
|
1927
1993
|
interpolated: false
|
|
1928
1994
|
},
|
|
1929
1995
|
"property-type": "constant"
|
|
1996
|
+
},
|
|
1997
|
+
"line-width-unit": {
|
|
1998
|
+
type: "enum",
|
|
1999
|
+
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.",
|
|
2000
|
+
values: {
|
|
2001
|
+
pixels: {
|
|
2002
|
+
doc: "Width is rendered in pixels."
|
|
2003
|
+
},
|
|
2004
|
+
meters: {
|
|
2005
|
+
doc: "Width is rendered in meters."
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
"default": "pixels",
|
|
2009
|
+
experimental: true,
|
|
2010
|
+
"private": true,
|
|
2011
|
+
transition: false,
|
|
2012
|
+
"sdk-support": {
|
|
2013
|
+
"basic functionality": {
|
|
2014
|
+
js: "3.9.0",
|
|
2015
|
+
android: "11.9.0",
|
|
2016
|
+
ios: "11.9.0"
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
expression: {
|
|
2020
|
+
interpolated: false,
|
|
2021
|
+
parameters: [
|
|
2022
|
+
"zoom"
|
|
2023
|
+
]
|
|
2024
|
+
},
|
|
2025
|
+
"property-type": "data-constant"
|
|
1930
2026
|
}
|
|
1931
2027
|
};
|
|
1932
2028
|
var layout_symbol = {
|
|
@@ -2041,7 +2137,7 @@ var layout_symbol = {
|
|
|
2041
2137
|
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`."
|
|
2042
2138
|
},
|
|
2043
2139
|
"viewport-y": {
|
|
2044
|
-
doc: "Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap
|
|
2140
|
+
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`."
|
|
2045
2141
|
},
|
|
2046
2142
|
source: {
|
|
2047
2143
|
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."
|
|
@@ -2095,6 +2191,36 @@ var layout_symbol = {
|
|
|
2095
2191
|
},
|
|
2096
2192
|
"property-type": "data-constant"
|
|
2097
2193
|
},
|
|
2194
|
+
"symbol-elevation-reference": {
|
|
2195
|
+
type: "enum",
|
|
2196
|
+
doc: "Selects the base of symbol-elevation.",
|
|
2197
|
+
values: {
|
|
2198
|
+
sea: {
|
|
2199
|
+
doc: "Elevate symbols relative to the sea level."
|
|
2200
|
+
},
|
|
2201
|
+
ground: {
|
|
2202
|
+
doc: "Elevate symbols relative to the ground's height below them."
|
|
2203
|
+
},
|
|
2204
|
+
"hd-road-markup": {
|
|
2205
|
+
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."
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
"default": "ground",
|
|
2209
|
+
experimental: true,
|
|
2210
|
+
"sdk-support": {
|
|
2211
|
+
"basic functionality": {
|
|
2212
|
+
android: "11.9.0",
|
|
2213
|
+
ios: "11.9.0"
|
|
2214
|
+
}
|
|
2215
|
+
},
|
|
2216
|
+
expression: {
|
|
2217
|
+
interpolated: false,
|
|
2218
|
+
parameters: [
|
|
2219
|
+
"zoom"
|
|
2220
|
+
]
|
|
2221
|
+
},
|
|
2222
|
+
"property-type": "data-constant"
|
|
2223
|
+
},
|
|
2098
2224
|
"icon-allow-overlap": {
|
|
2099
2225
|
type: "boolean",
|
|
2100
2226
|
"default": false,
|
|
@@ -2248,9 +2374,7 @@ var layout_symbol = {
|
|
|
2248
2374
|
},
|
|
2249
2375
|
"sdk-support": {
|
|
2250
2376
|
"basic functionality": {
|
|
2251
|
-
js: "3.8.0"
|
|
2252
|
-
android: "11.8.0",
|
|
2253
|
-
ios: "11.8.0"
|
|
2377
|
+
js: "3.8.0"
|
|
2254
2378
|
}
|
|
2255
2379
|
},
|
|
2256
2380
|
"property-type": "data-constant"
|
|
@@ -2762,9 +2886,7 @@ var layout_symbol = {
|
|
|
2762
2886
|
},
|
|
2763
2887
|
"sdk-support": {
|
|
2764
2888
|
"basic functionality": {
|
|
2765
|
-
js: "3.8.0"
|
|
2766
|
-
android: "11.8.0",
|
|
2767
|
-
ios: "11.8.0"
|
|
2889
|
+
js: "3.8.0"
|
|
2768
2890
|
}
|
|
2769
2891
|
},
|
|
2770
2892
|
"property-type": "data-constant"
|
|
@@ -3468,6 +3590,62 @@ var filter_fill = {
|
|
|
3468
3590
|
]
|
|
3469
3591
|
}
|
|
3470
3592
|
};
|
|
3593
|
+
var filter_hillshade = {
|
|
3594
|
+
type: "boolean",
|
|
3595
|
+
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.",
|
|
3596
|
+
"default": false,
|
|
3597
|
+
transition: false,
|
|
3598
|
+
"property-type": "data-driven",
|
|
3599
|
+
expression: {
|
|
3600
|
+
interpolated: false,
|
|
3601
|
+
parameters: [
|
|
3602
|
+
"zoom",
|
|
3603
|
+
"feature"
|
|
3604
|
+
]
|
|
3605
|
+
}
|
|
3606
|
+
};
|
|
3607
|
+
var filter_raster = {
|
|
3608
|
+
type: "boolean",
|
|
3609
|
+
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.",
|
|
3610
|
+
"default": false,
|
|
3611
|
+
transition: false,
|
|
3612
|
+
"property-type": "data-driven",
|
|
3613
|
+
expression: {
|
|
3614
|
+
interpolated: false,
|
|
3615
|
+
parameters: [
|
|
3616
|
+
"zoom",
|
|
3617
|
+
"feature"
|
|
3618
|
+
]
|
|
3619
|
+
}
|
|
3620
|
+
};
|
|
3621
|
+
var filter_clip = {
|
|
3622
|
+
type: "boolean",
|
|
3623
|
+
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.",
|
|
3624
|
+
"default": false,
|
|
3625
|
+
transition: false,
|
|
3626
|
+
"property-type": "data-driven",
|
|
3627
|
+
expression: {
|
|
3628
|
+
interpolated: false,
|
|
3629
|
+
parameters: [
|
|
3630
|
+
"zoom",
|
|
3631
|
+
"feature"
|
|
3632
|
+
]
|
|
3633
|
+
}
|
|
3634
|
+
};
|
|
3635
|
+
var filter_model = {
|
|
3636
|
+
type: "boolean",
|
|
3637
|
+
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.",
|
|
3638
|
+
"default": false,
|
|
3639
|
+
transition: false,
|
|
3640
|
+
"property-type": "data-driven",
|
|
3641
|
+
expression: {
|
|
3642
|
+
interpolated: false,
|
|
3643
|
+
parameters: [
|
|
3644
|
+
"zoom",
|
|
3645
|
+
"feature"
|
|
3646
|
+
]
|
|
3647
|
+
}
|
|
3648
|
+
};
|
|
3471
3649
|
var filter_line = {
|
|
3472
3650
|
type: "boolean",
|
|
3473
3651
|
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.",
|
|
@@ -3959,6 +4137,17 @@ var expression_name = {
|
|
|
3959
4137
|
}
|
|
3960
4138
|
}
|
|
3961
4139
|
},
|
|
4140
|
+
"to-hsla": {
|
|
4141
|
+
doc: "Returns a four-element array containing the input color's Hue, Saturation, Luminance and alpha components, in that order.",
|
|
4142
|
+
group: "Color",
|
|
4143
|
+
"sdk-support": {
|
|
4144
|
+
"basic functionality": {
|
|
4145
|
+
js: "3.9.0",
|
|
4146
|
+
android: "11.9.0",
|
|
4147
|
+
ios: "11.9.0"
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
},
|
|
3962
4151
|
"to-color": {
|
|
3963
4152
|
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.",
|
|
3964
4153
|
group: "Types",
|
|
@@ -4147,7 +4336,7 @@ var expression_name = {
|
|
|
4147
4336
|
}
|
|
4148
4337
|
},
|
|
4149
4338
|
"line-progress": {
|
|
4150
|
-
doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient`
|
|
4339
|
+
doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient` and `line-z-offset` properties.",
|
|
4151
4340
|
group: "Feature data",
|
|
4152
4341
|
"sdk-support": {
|
|
4153
4342
|
"basic functionality": {
|
|
@@ -4892,11 +5081,11 @@ var snow = {
|
|
|
4892
5081
|
relaxZoomRestriction: true
|
|
4893
5082
|
},
|
|
4894
5083
|
transition: true,
|
|
4895
|
-
doc: "Snow particles density.",
|
|
5084
|
+
doc: "Snow particles density. Controls the overall particles number.",
|
|
4896
5085
|
"sdk-support": {
|
|
4897
5086
|
"basic functionality": {
|
|
4898
|
-
android: "11.
|
|
4899
|
-
ios: "11.
|
|
5087
|
+
android: "11.9.0",
|
|
5088
|
+
ios: "11.9.0"
|
|
4900
5089
|
}
|
|
4901
5090
|
}
|
|
4902
5091
|
},
|
|
@@ -4916,11 +5105,11 @@ var snow = {
|
|
|
4916
5105
|
relaxZoomRestriction: true
|
|
4917
5106
|
},
|
|
4918
5107
|
transition: true,
|
|
4919
|
-
doc: "Snow particles movement factor.",
|
|
5108
|
+
doc: "Snow particles movement factor. Controls the overall particles movement speed.",
|
|
4920
5109
|
"sdk-support": {
|
|
4921
5110
|
"basic functionality": {
|
|
4922
|
-
android: "11.
|
|
4923
|
-
ios: "11.
|
|
5111
|
+
android: "11.9.0",
|
|
5112
|
+
ios: "11.9.0"
|
|
4924
5113
|
}
|
|
4925
5114
|
}
|
|
4926
5115
|
},
|
|
@@ -4941,15 +5130,15 @@ var snow = {
|
|
|
4941
5130
|
doc: "Snow particles color.",
|
|
4942
5131
|
"sdk-support": {
|
|
4943
5132
|
"basic functionality": {
|
|
4944
|
-
android: "11.
|
|
4945
|
-
ios: "11.
|
|
5133
|
+
android: "11.9.0",
|
|
5134
|
+
ios: "11.9.0"
|
|
4946
5135
|
}
|
|
4947
5136
|
}
|
|
4948
5137
|
},
|
|
4949
5138
|
opacity: {
|
|
4950
5139
|
type: "number",
|
|
4951
5140
|
"property-type": "data-constant",
|
|
4952
|
-
"default":
|
|
5141
|
+
"default": 0.9,
|
|
4953
5142
|
minimum: 0,
|
|
4954
5143
|
maximum: 1,
|
|
4955
5144
|
experimental: true,
|
|
@@ -4965,15 +5154,15 @@ var snow = {
|
|
|
4965
5154
|
doc: "Snow particles opacity.",
|
|
4966
5155
|
"sdk-support": {
|
|
4967
5156
|
"basic functionality": {
|
|
4968
|
-
android: "11.
|
|
4969
|
-
ios: "11.
|
|
5157
|
+
android: "11.9.0",
|
|
5158
|
+
ios: "11.9.0"
|
|
4970
5159
|
}
|
|
4971
5160
|
}
|
|
4972
5161
|
},
|
|
4973
5162
|
vignette: {
|
|
4974
5163
|
type: "number",
|
|
4975
5164
|
"property-type": "data-constant",
|
|
4976
|
-
"default": 0,
|
|
5165
|
+
"default": 0.3,
|
|
4977
5166
|
minimum: 0,
|
|
4978
5167
|
maximum: 1,
|
|
4979
5168
|
experimental: true,
|
|
@@ -4986,15 +5175,37 @@ var snow = {
|
|
|
4986
5175
|
relaxZoomRestriction: true
|
|
4987
5176
|
},
|
|
4988
5177
|
transition: true,
|
|
4989
|
-
doc: "Snow vignette screen-space effect.",
|
|
5178
|
+
doc: "Snow vignette screen-space effect. Adds snow tint to screen corners",
|
|
4990
5179
|
"sdk-support": {
|
|
4991
5180
|
"basic functionality": {
|
|
4992
|
-
android: "11.
|
|
4993
|
-
ios: "11.
|
|
5181
|
+
android: "11.9.0",
|
|
5182
|
+
ios: "11.9.0"
|
|
5183
|
+
}
|
|
5184
|
+
}
|
|
5185
|
+
},
|
|
5186
|
+
"vignette-color": {
|
|
5187
|
+
type: "color",
|
|
5188
|
+
"property-type": "data-constant",
|
|
5189
|
+
"default": "#ffffff",
|
|
5190
|
+
experimental: true,
|
|
5191
|
+
expression: {
|
|
5192
|
+
interpolated: true,
|
|
5193
|
+
parameters: [
|
|
5194
|
+
"zoom",
|
|
5195
|
+
"measure-light"
|
|
5196
|
+
],
|
|
5197
|
+
relaxZoomRestriction: true
|
|
5198
|
+
},
|
|
5199
|
+
transition: true,
|
|
5200
|
+
doc: "Snow vignette screen-space corners tint color.",
|
|
5201
|
+
"sdk-support": {
|
|
5202
|
+
"basic functionality": {
|
|
5203
|
+
android: "11.9.0",
|
|
5204
|
+
ios: "11.9.0"
|
|
4994
5205
|
}
|
|
4995
5206
|
}
|
|
4996
5207
|
},
|
|
4997
|
-
|
|
5208
|
+
"center-thinning": {
|
|
4998
5209
|
type: "number",
|
|
4999
5210
|
"property-type": "data-constant",
|
|
5000
5211
|
"default": 1,
|
|
@@ -5013,8 +5224,8 @@ var snow = {
|
|
|
5013
5224
|
doc: "Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5014
5225
|
"sdk-support": {
|
|
5015
5226
|
"basic functionality": {
|
|
5016
|
-
android: "11.
|
|
5017
|
-
ios: "11.
|
|
5227
|
+
android: "11.9.0",
|
|
5228
|
+
ios: "11.9.0"
|
|
5018
5229
|
}
|
|
5019
5230
|
}
|
|
5020
5231
|
},
|
|
@@ -5039,15 +5250,39 @@ var snow = {
|
|
|
5039
5250
|
],
|
|
5040
5251
|
relaxZoomRestriction: true
|
|
5041
5252
|
},
|
|
5042
|
-
doc: "Main snow particles direction.
|
|
5253
|
+
doc: "Main snow particles direction. Azimuth and polar angles",
|
|
5043
5254
|
example: [
|
|
5044
5255
|
0,
|
|
5045
5256
|
45
|
|
5046
5257
|
],
|
|
5047
5258
|
"sdk-support": {
|
|
5048
5259
|
"basic functionality": {
|
|
5049
|
-
android: "11.
|
|
5050
|
-
ios: "11.
|
|
5260
|
+
android: "11.9.0",
|
|
5261
|
+
ios: "11.9.0"
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
},
|
|
5265
|
+
"flake-size": {
|
|
5266
|
+
type: "number",
|
|
5267
|
+
"property-type": "data-constant",
|
|
5268
|
+
"default": 1,
|
|
5269
|
+
minimum: 0,
|
|
5270
|
+
maximum: 5,
|
|
5271
|
+
experimental: true,
|
|
5272
|
+
expression: {
|
|
5273
|
+
interpolated: true,
|
|
5274
|
+
parameters: [
|
|
5275
|
+
"zoom",
|
|
5276
|
+
"measure-light"
|
|
5277
|
+
],
|
|
5278
|
+
relaxZoomRestriction: true
|
|
5279
|
+
},
|
|
5280
|
+
transition: true,
|
|
5281
|
+
doc: "Snow flake particle size. Correlates with individual particle screen size",
|
|
5282
|
+
"sdk-support": {
|
|
5283
|
+
"basic functionality": {
|
|
5284
|
+
android: "11.9.0",
|
|
5285
|
+
ios: "11.9.0"
|
|
5051
5286
|
}
|
|
5052
5287
|
}
|
|
5053
5288
|
}
|
|
@@ -5069,11 +5304,11 @@ var rain = {
|
|
|
5069
5304
|
relaxZoomRestriction: true
|
|
5070
5305
|
},
|
|
5071
5306
|
transition: true,
|
|
5072
|
-
doc: "Rain particles density.",
|
|
5307
|
+
doc: "Rain particles density. Controls the overall screen density of the rain.",
|
|
5073
5308
|
"sdk-support": {
|
|
5074
5309
|
"basic functionality": {
|
|
5075
|
-
android: "11.
|
|
5076
|
-
ios: "11.
|
|
5310
|
+
android: "11.9.0",
|
|
5311
|
+
ios: "11.9.0"
|
|
5077
5312
|
}
|
|
5078
5313
|
}
|
|
5079
5314
|
},
|
|
@@ -5093,18 +5328,18 @@ var rain = {
|
|
|
5093
5328
|
relaxZoomRestriction: true
|
|
5094
5329
|
},
|
|
5095
5330
|
transition: true,
|
|
5096
|
-
doc: "Rain particles movement factor.",
|
|
5331
|
+
doc: "Rain particles movement factor. Controls the overall rain particles speed",
|
|
5097
5332
|
"sdk-support": {
|
|
5098
5333
|
"basic functionality": {
|
|
5099
|
-
android: "11.
|
|
5100
|
-
ios: "11.
|
|
5334
|
+
android: "11.9.0",
|
|
5335
|
+
ios: "11.9.0"
|
|
5101
5336
|
}
|
|
5102
5337
|
}
|
|
5103
5338
|
},
|
|
5104
5339
|
color: {
|
|
5105
5340
|
type: "color",
|
|
5106
5341
|
"property-type": "data-constant",
|
|
5107
|
-
"default": "#
|
|
5342
|
+
"default": "#919191",
|
|
5108
5343
|
experimental: true,
|
|
5109
5344
|
expression: {
|
|
5110
5345
|
interpolated: true,
|
|
@@ -5115,18 +5350,18 @@ var rain = {
|
|
|
5115
5350
|
relaxZoomRestriction: true
|
|
5116
5351
|
},
|
|
5117
5352
|
transition: true,
|
|
5118
|
-
doc: "",
|
|
5353
|
+
doc: "Individual rain particle dorplets color.",
|
|
5119
5354
|
"sdk-support": {
|
|
5120
5355
|
"basic functionality": {
|
|
5121
|
-
android: "11.
|
|
5122
|
-
ios: "11.
|
|
5356
|
+
android: "11.9.0",
|
|
5357
|
+
ios: "11.9.0"
|
|
5123
5358
|
}
|
|
5124
5359
|
}
|
|
5125
5360
|
},
|
|
5126
5361
|
opacity: {
|
|
5127
5362
|
type: "number",
|
|
5128
5363
|
"property-type": "data-constant",
|
|
5129
|
-
"default":
|
|
5364
|
+
"default": 0.19,
|
|
5130
5365
|
minimum: 0,
|
|
5131
5366
|
maximum: 1,
|
|
5132
5367
|
experimental: true,
|
|
@@ -5142,15 +5377,15 @@ var rain = {
|
|
|
5142
5377
|
doc: "Rain particles opacity.",
|
|
5143
5378
|
"sdk-support": {
|
|
5144
5379
|
"basic functionality": {
|
|
5145
|
-
android: "11.
|
|
5146
|
-
ios: "11.
|
|
5380
|
+
android: "11.9.0",
|
|
5381
|
+
ios: "11.9.0"
|
|
5147
5382
|
}
|
|
5148
5383
|
}
|
|
5149
5384
|
},
|
|
5150
5385
|
vignette: {
|
|
5151
5386
|
type: "number",
|
|
5152
5387
|
"property-type": "data-constant",
|
|
5153
|
-
"default": 0,
|
|
5388
|
+
"default": 0.3,
|
|
5154
5389
|
minimum: 0,
|
|
5155
5390
|
maximum: 1,
|
|
5156
5391
|
experimental: true,
|
|
@@ -5163,15 +5398,37 @@ var rain = {
|
|
|
5163
5398
|
relaxZoomRestriction: true
|
|
5164
5399
|
},
|
|
5165
5400
|
transition: true,
|
|
5166
|
-
doc: "
|
|
5401
|
+
doc: "Screen-space vignette rain tinting effect intensity.",
|
|
5167
5402
|
"sdk-support": {
|
|
5168
5403
|
"basic functionality": {
|
|
5169
|
-
android: "11.
|
|
5170
|
-
ios: "11.
|
|
5404
|
+
android: "11.9.0",
|
|
5405
|
+
ios: "11.9.0"
|
|
5406
|
+
}
|
|
5407
|
+
}
|
|
5408
|
+
},
|
|
5409
|
+
"vignette-color": {
|
|
5410
|
+
type: "color",
|
|
5411
|
+
"property-type": "data-constant",
|
|
5412
|
+
"default": "#ffffff",
|
|
5413
|
+
experimental: true,
|
|
5414
|
+
expression: {
|
|
5415
|
+
interpolated: true,
|
|
5416
|
+
parameters: [
|
|
5417
|
+
"zoom",
|
|
5418
|
+
"measure-light"
|
|
5419
|
+
],
|
|
5420
|
+
relaxZoomRestriction: true
|
|
5421
|
+
},
|
|
5422
|
+
transition: true,
|
|
5423
|
+
doc: "Rain vignette screen-space corners tint color.",
|
|
5424
|
+
"sdk-support": {
|
|
5425
|
+
"basic functionality": {
|
|
5426
|
+
android: "11.9.0",
|
|
5427
|
+
ios: "11.9.0"
|
|
5171
5428
|
}
|
|
5172
5429
|
}
|
|
5173
5430
|
},
|
|
5174
|
-
|
|
5431
|
+
"center-thinning": {
|
|
5175
5432
|
type: "number",
|
|
5176
5433
|
"property-type": "data-constant",
|
|
5177
5434
|
"default": 1,
|
|
@@ -5190,8 +5447,8 @@ var rain = {
|
|
|
5190
5447
|
doc: "Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5191
5448
|
"sdk-support": {
|
|
5192
5449
|
"basic functionality": {
|
|
5193
|
-
android: "11.
|
|
5194
|
-
ios: "11.
|
|
5450
|
+
android: "11.9.0",
|
|
5451
|
+
ios: "11.9.0"
|
|
5195
5452
|
}
|
|
5196
5453
|
}
|
|
5197
5454
|
},
|
|
@@ -5216,15 +5473,72 @@ var rain = {
|
|
|
5216
5473
|
],
|
|
5217
5474
|
relaxZoomRestriction: true
|
|
5218
5475
|
},
|
|
5219
|
-
doc: "Main rain particles direction.
|
|
5476
|
+
doc: "Main rain particles direction. Azimuth and polar angles.",
|
|
5220
5477
|
example: [
|
|
5221
5478
|
0,
|
|
5222
5479
|
45
|
|
5223
5480
|
],
|
|
5224
5481
|
"sdk-support": {
|
|
5225
5482
|
"basic functionality": {
|
|
5226
|
-
android: "11.
|
|
5227
|
-
ios: "11.
|
|
5483
|
+
android: "11.9.0",
|
|
5484
|
+
ios: "11.9.0"
|
|
5485
|
+
}
|
|
5486
|
+
}
|
|
5487
|
+
},
|
|
5488
|
+
"droplet-size": {
|
|
5489
|
+
type: "array",
|
|
5490
|
+
"default": [
|
|
5491
|
+
1,
|
|
5492
|
+
10
|
|
5493
|
+
],
|
|
5494
|
+
minimum: 0,
|
|
5495
|
+
maximum: 20,
|
|
5496
|
+
length: 2,
|
|
5497
|
+
value: "number",
|
|
5498
|
+
"property-type": "data-constant",
|
|
5499
|
+
transition: true,
|
|
5500
|
+
experimental: true,
|
|
5501
|
+
expression: {
|
|
5502
|
+
interpolated: true,
|
|
5503
|
+
parameters: [
|
|
5504
|
+
"zoom",
|
|
5505
|
+
"measure-light"
|
|
5506
|
+
],
|
|
5507
|
+
relaxZoomRestriction: true
|
|
5508
|
+
},
|
|
5509
|
+
doc: "Rain droplet size. x - normal to direction, y - along direction",
|
|
5510
|
+
example: [
|
|
5511
|
+
0,
|
|
5512
|
+
45
|
|
5513
|
+
],
|
|
5514
|
+
"sdk-support": {
|
|
5515
|
+
"basic functionality": {
|
|
5516
|
+
android: "11.9.0",
|
|
5517
|
+
ios: "11.9.0"
|
|
5518
|
+
}
|
|
5519
|
+
}
|
|
5520
|
+
},
|
|
5521
|
+
"distortion-strength": {
|
|
5522
|
+
type: "number",
|
|
5523
|
+
"property-type": "data-constant",
|
|
5524
|
+
"default": 0.5,
|
|
5525
|
+
minimum: 0,
|
|
5526
|
+
maximum: 1,
|
|
5527
|
+
experimental: true,
|
|
5528
|
+
expression: {
|
|
5529
|
+
interpolated: true,
|
|
5530
|
+
parameters: [
|
|
5531
|
+
"zoom",
|
|
5532
|
+
"measure-light"
|
|
5533
|
+
],
|
|
5534
|
+
relaxZoomRestriction: true
|
|
5535
|
+
},
|
|
5536
|
+
transition: true,
|
|
5537
|
+
doc: "Rain particles screen-space distortion strength.",
|
|
5538
|
+
"sdk-support": {
|
|
5539
|
+
"basic functionality": {
|
|
5540
|
+
android: "11.9.0",
|
|
5541
|
+
ios: "11.9.0"
|
|
5228
5542
|
}
|
|
5229
5543
|
}
|
|
5230
5544
|
}
|
|
@@ -5262,7 +5576,29 @@ var camera = {
|
|
|
5262
5576
|
var colorTheme = {
|
|
5263
5577
|
data: {
|
|
5264
5578
|
type: "string",
|
|
5265
|
-
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.",
|
|
5579
|
+
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.",
|
|
5580
|
+
transition: false,
|
|
5581
|
+
"property-type": "data-constant",
|
|
5582
|
+
expression: {
|
|
5583
|
+
interpolated: false
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
};
|
|
5587
|
+
var indoor = {
|
|
5588
|
+
floorplanFeaturesetId: {
|
|
5589
|
+
type: "string",
|
|
5590
|
+
doc: "An ID of a featureset to be used to query indoor floorplans.",
|
|
5591
|
+
experimental: true,
|
|
5592
|
+
transition: false,
|
|
5593
|
+
"property-type": "data-constant",
|
|
5594
|
+
expression: {
|
|
5595
|
+
interpolated: false
|
|
5596
|
+
}
|
|
5597
|
+
},
|
|
5598
|
+
buildingFeaturesetId: {
|
|
5599
|
+
type: "string",
|
|
5600
|
+
doc: "An ID of a featureset to be used to add interactivity for building selection.",
|
|
5601
|
+
experimental: true,
|
|
5266
5602
|
transition: false,
|
|
5267
5603
|
"property-type": "data-constant",
|
|
5268
5604
|
expression: {
|
|
@@ -5929,7 +6265,8 @@ var paint_line = {
|
|
|
5929
6265
|
"zoom",
|
|
5930
6266
|
"feature",
|
|
5931
6267
|
"feature-state",
|
|
5932
|
-
"measure-light"
|
|
6268
|
+
"measure-light",
|
|
6269
|
+
"line-progress"
|
|
5933
6270
|
]
|
|
5934
6271
|
},
|
|
5935
6272
|
"property-type": "data-driven"
|
|
@@ -7546,34 +7883,6 @@ var paint_symbol = {
|
|
|
7546
7883
|
]
|
|
7547
7884
|
},
|
|
7548
7885
|
"property-type": "data-driven"
|
|
7549
|
-
},
|
|
7550
|
-
"symbol-elevation-reference": {
|
|
7551
|
-
type: "enum",
|
|
7552
|
-
doc: "Selects the base of symbol-elevation.",
|
|
7553
|
-
values: {
|
|
7554
|
-
sea: {
|
|
7555
|
-
doc: "Elevate symbols relative to the sea level."
|
|
7556
|
-
},
|
|
7557
|
-
ground: {
|
|
7558
|
-
doc: "Elevate symbols relative to the ground's height below them."
|
|
7559
|
-
}
|
|
7560
|
-
},
|
|
7561
|
-
"default": "ground",
|
|
7562
|
-
experimental: true,
|
|
7563
|
-
"sdk-support": {
|
|
7564
|
-
"basic functionality": {
|
|
7565
|
-
js: "3.7.0",
|
|
7566
|
-
android: "11.7.0",
|
|
7567
|
-
ios: "11.7.0"
|
|
7568
|
-
}
|
|
7569
|
-
},
|
|
7570
|
-
expression: {
|
|
7571
|
-
interpolated: false,
|
|
7572
|
-
parameters: [
|
|
7573
|
-
"zoom"
|
|
7574
|
-
]
|
|
7575
|
-
},
|
|
7576
|
-
"property-type": "data-constant"
|
|
7577
7886
|
}
|
|
7578
7887
|
};
|
|
7579
7888
|
var paint_raster = {
|
|
@@ -8083,7 +8392,7 @@ var paint_background = {
|
|
|
8083
8392
|
doc: "The background is aligned to the plane of the map."
|
|
8084
8393
|
},
|
|
8085
8394
|
viewport: {
|
|
8086
|
-
doc: "The background is aligned to the plane of the viewport, covering the whole screen."
|
|
8395
|
+
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."
|
|
8087
8396
|
}
|
|
8088
8397
|
},
|
|
8089
8398
|
"default": "map",
|
|
@@ -8100,6 +8409,7 @@ var paint_background = {
|
|
|
8100
8409
|
parameters: [
|
|
8101
8410
|
]
|
|
8102
8411
|
},
|
|
8412
|
+
experimental: true,
|
|
8103
8413
|
"property-type": "data-constant"
|
|
8104
8414
|
},
|
|
8105
8415
|
"background-color": {
|
|
@@ -8451,11 +8761,13 @@ var paint_model = {
|
|
|
8451
8761
|
"default": 1,
|
|
8452
8762
|
minimum: 0,
|
|
8453
8763
|
maximum: 1,
|
|
8454
|
-
doc: "The opacity of the model layer.",
|
|
8764
|
+
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.",
|
|
8455
8765
|
transition: true,
|
|
8456
8766
|
expression: {
|
|
8457
8767
|
interpolated: true,
|
|
8458
8768
|
parameters: [
|
|
8769
|
+
"feature",
|
|
8770
|
+
"feature-state",
|
|
8459
8771
|
"zoom"
|
|
8460
8772
|
]
|
|
8461
8773
|
},
|
|
@@ -8464,9 +8776,14 @@ var paint_model = {
|
|
|
8464
8776
|
js: "3.0.0",
|
|
8465
8777
|
android: "11.0.0",
|
|
8466
8778
|
ios: "11.0.0"
|
|
8779
|
+
},
|
|
8780
|
+
"data-driven styling": {
|
|
8781
|
+
js: "3.9.0",
|
|
8782
|
+
android: "11.9.0",
|
|
8783
|
+
ios: "11.9.0"
|
|
8467
8784
|
}
|
|
8468
8785
|
},
|
|
8469
|
-
"property-type": "data-
|
|
8786
|
+
"property-type": "data-driven"
|
|
8470
8787
|
},
|
|
8471
8788
|
"model-rotation": {
|
|
8472
8789
|
type: "array",
|
|
@@ -8893,6 +9210,11 @@ var v8 = {
|
|
|
8893
9210
|
data: {
|
|
8894
9211
|
type: "$root",
|
|
8895
9212
|
doc: "The inlined style that must correspond to the contents of the specified URL."
|
|
9213
|
+
},
|
|
9214
|
+
"color-theme": {
|
|
9215
|
+
type: "colorTheme",
|
|
9216
|
+
optional: true,
|
|
9217
|
+
doc: "If specified, it overrides the color-theme of the imported style."
|
|
8896
9218
|
}
|
|
8897
9219
|
},
|
|
8898
9220
|
config: config,
|
|
@@ -9062,6 +9384,24 @@ var v8 = {
|
|
|
9062
9384
|
filter: filter,
|
|
9063
9385
|
filter_symbol: filter_symbol,
|
|
9064
9386
|
filter_fill: filter_fill,
|
|
9387
|
+
filter_hillshade: filter_hillshade,
|
|
9388
|
+
filter_raster: filter_raster,
|
|
9389
|
+
"filter_raster-particle": {
|
|
9390
|
+
type: "boolean",
|
|
9391
|
+
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.",
|
|
9392
|
+
"default": false,
|
|
9393
|
+
transition: false,
|
|
9394
|
+
"property-type": "data-driven",
|
|
9395
|
+
expression: {
|
|
9396
|
+
interpolated: false,
|
|
9397
|
+
parameters: [
|
|
9398
|
+
"zoom",
|
|
9399
|
+
"feature"
|
|
9400
|
+
]
|
|
9401
|
+
}
|
|
9402
|
+
},
|
|
9403
|
+
filter_clip: filter_clip,
|
|
9404
|
+
filter_model: filter_model,
|
|
9065
9405
|
filter_line: filter_line,
|
|
9066
9406
|
filter_circle: filter_circle,
|
|
9067
9407
|
"filter_fill-extrusion": {
|
|
@@ -9151,6 +9491,7 @@ var v8 = {
|
|
|
9151
9491
|
rain: rain,
|
|
9152
9492
|
camera: camera,
|
|
9153
9493
|
colorTheme: colorTheme,
|
|
9494
|
+
indoor: indoor,
|
|
9154
9495
|
light: light,
|
|
9155
9496
|
projection: projection,
|
|
9156
9497
|
terrain: terrain,
|
|
@@ -11546,7 +11887,7 @@ class Color {
|
|
|
11546
11887
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
11547
11888
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
11548
11889
|
*/
|
|
11549
|
-
|
|
11890
|
+
toStringPremultipliedAlpha() {
|
|
11550
11891
|
const [r, g, b, a] = this.a === 0 ? [
|
|
11551
11892
|
0,
|
|
11552
11893
|
0,
|
|
@@ -11560,10 +11901,22 @@ class Color {
|
|
|
11560
11901
|
];
|
|
11561
11902
|
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
11562
11903
|
}
|
|
11904
|
+
toString() {
|
|
11905
|
+
const [r, g, b, a] = [
|
|
11906
|
+
this.r,
|
|
11907
|
+
this.g,
|
|
11908
|
+
this.b,
|
|
11909
|
+
this.a
|
|
11910
|
+
];
|
|
11911
|
+
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
11912
|
+
}
|
|
11563
11913
|
toRenderColor(lut) {
|
|
11564
11914
|
const {r, g, b, a} = this;
|
|
11565
11915
|
return new RenderColor(lut, r, g, b, a);
|
|
11566
11916
|
}
|
|
11917
|
+
clone() {
|
|
11918
|
+
return new Color(this.r, this.g, this.b, this.a);
|
|
11919
|
+
}
|
|
11567
11920
|
}
|
|
11568
11921
|
class RenderColor {
|
|
11569
11922
|
constructor(lut, r, g, b, a) {
|
|
@@ -11625,6 +11978,53 @@ class RenderColor {
|
|
|
11625
11978
|
];
|
|
11626
11979
|
}
|
|
11627
11980
|
/**
|
|
11981
|
+
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
11982
|
+
*
|
|
11983
|
+
* @returns An array of HSLA color values.
|
|
11984
|
+
*/
|
|
11985
|
+
toHslaArray() {
|
|
11986
|
+
if (this.a === 0) {
|
|
11987
|
+
return [
|
|
11988
|
+
0,
|
|
11989
|
+
0,
|
|
11990
|
+
0,
|
|
11991
|
+
0
|
|
11992
|
+
];
|
|
11993
|
+
}
|
|
11994
|
+
const {r, g, b, a} = this;
|
|
11995
|
+
const red = Math.min(Math.max(r / a, 0), 1);
|
|
11996
|
+
const green = Math.min(Math.max(g / a, 0), 1);
|
|
11997
|
+
const blue = Math.min(Math.max(b / a, 0), 1);
|
|
11998
|
+
const min = Math.min(red, green, blue);
|
|
11999
|
+
const max = Math.max(red, green, blue);
|
|
12000
|
+
const l = (min + max) / 2;
|
|
12001
|
+
if (min === max) {
|
|
12002
|
+
return [
|
|
12003
|
+
0,
|
|
12004
|
+
0,
|
|
12005
|
+
l * 100,
|
|
12006
|
+
a
|
|
12007
|
+
];
|
|
12008
|
+
}
|
|
12009
|
+
const delta = max - min;
|
|
12010
|
+
const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
12011
|
+
let h = 0;
|
|
12012
|
+
if (max === red) {
|
|
12013
|
+
h = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
12014
|
+
} else if (max === green) {
|
|
12015
|
+
h = (blue - red) / delta + 2;
|
|
12016
|
+
} else if (max === blue) {
|
|
12017
|
+
h = (red - green) / delta + 4;
|
|
12018
|
+
}
|
|
12019
|
+
h *= 60;
|
|
12020
|
+
return [
|
|
12021
|
+
Math.min(Math.max(h, 0), 360),
|
|
12022
|
+
Math.min(Math.max(s * 100, 0), 100),
|
|
12023
|
+
Math.min(Math.max(l * 100, 0), 100),
|
|
12024
|
+
a
|
|
12025
|
+
];
|
|
12026
|
+
}
|
|
12027
|
+
/**
|
|
11628
12028
|
* Returns a RGBA array of float values representing the color, unpremultiplied by A.
|
|
11629
12029
|
*
|
|
11630
12030
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
@@ -11741,7 +12141,7 @@ class Formatted {
|
|
|
11741
12141
|
isEmpty() {
|
|
11742
12142
|
if (this.sections.length === 0)
|
|
11743
12143
|
return true;
|
|
11744
|
-
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary
|
|
12144
|
+
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary);
|
|
11745
12145
|
}
|
|
11746
12146
|
static factory(text) {
|
|
11747
12147
|
if (text instanceof Formatted) {
|
|
@@ -11785,42 +12185,113 @@ class Formatted {
|
|
|
11785
12185
|
}
|
|
11786
12186
|
}
|
|
11787
12187
|
|
|
12188
|
+
class ImageIdWithOptions {
|
|
12189
|
+
constructor(id, options) {
|
|
12190
|
+
this.id = id;
|
|
12191
|
+
this.options = options || { params: {} };
|
|
12192
|
+
if (!this.options.transform) {
|
|
12193
|
+
this.options.transform = new DOMMatrix([
|
|
12194
|
+
1,
|
|
12195
|
+
0,
|
|
12196
|
+
0,
|
|
12197
|
+
1,
|
|
12198
|
+
0,
|
|
12199
|
+
0
|
|
12200
|
+
]);
|
|
12201
|
+
} else {
|
|
12202
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12203
|
+
this.options.transform = new DOMMatrix([
|
|
12204
|
+
a,
|
|
12205
|
+
b,
|
|
12206
|
+
c,
|
|
12207
|
+
d,
|
|
12208
|
+
e,
|
|
12209
|
+
f
|
|
12210
|
+
]);
|
|
12211
|
+
}
|
|
12212
|
+
}
|
|
12213
|
+
static deserializeFromString(serialized) {
|
|
12214
|
+
const deserializedObject = JSON.parse(serialized);
|
|
12215
|
+
({ params: deserializedObject.options.params });
|
|
12216
|
+
const {a, b, c, d, e, f} = deserializedObject.options.transform;
|
|
12217
|
+
new DOMMatrix([
|
|
12218
|
+
a,
|
|
12219
|
+
b,
|
|
12220
|
+
c,
|
|
12221
|
+
d,
|
|
12222
|
+
e,
|
|
12223
|
+
f
|
|
12224
|
+
]);
|
|
12225
|
+
return new ImageIdWithOptions(deserializedObject.id, deserializedObject.options);
|
|
12226
|
+
}
|
|
12227
|
+
scaleSelf(factor) {
|
|
12228
|
+
this.options.transform = this.options.transform.scale(factor);
|
|
12229
|
+
return this;
|
|
12230
|
+
}
|
|
12231
|
+
serialize() {
|
|
12232
|
+
const serialisedObject = { id: this.id };
|
|
12233
|
+
if (this.options) {
|
|
12234
|
+
serialisedObject.options = this.options;
|
|
12235
|
+
}
|
|
12236
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12237
|
+
serialisedObject.options.transform = {
|
|
12238
|
+
a,
|
|
12239
|
+
b,
|
|
12240
|
+
c,
|
|
12241
|
+
d,
|
|
12242
|
+
e,
|
|
12243
|
+
f
|
|
12244
|
+
};
|
|
12245
|
+
return JSON.stringify(serialisedObject);
|
|
12246
|
+
}
|
|
12247
|
+
}
|
|
12248
|
+
|
|
11788
12249
|
class ResolvedImage {
|
|
11789
12250
|
constructor(options) {
|
|
11790
12251
|
this.namePrimary = options.namePrimary;
|
|
11791
12252
|
if (options.nameSecondary) {
|
|
11792
12253
|
this.nameSecondary = options.nameSecondary;
|
|
11793
12254
|
}
|
|
12255
|
+
if (options.optionsPrimary) {
|
|
12256
|
+
this.optionsPrimary = options.optionsPrimary;
|
|
12257
|
+
}
|
|
12258
|
+
if (options.optionsSecondary) {
|
|
12259
|
+
this.optionsSecondary = options.optionsSecondary;
|
|
12260
|
+
}
|
|
11794
12261
|
this.available = options.available;
|
|
11795
12262
|
}
|
|
11796
12263
|
toString() {
|
|
11797
|
-
if (this.nameSecondary) {
|
|
12264
|
+
if (this.namePrimary && this.nameSecondary) {
|
|
11798
12265
|
return `[${ this.namePrimary },${ this.nameSecondary }]`;
|
|
11799
12266
|
}
|
|
11800
12267
|
return this.namePrimary;
|
|
11801
12268
|
}
|
|
11802
|
-
|
|
12269
|
+
getPrimary() {
|
|
12270
|
+
return new ImageIdWithOptions(this.namePrimary, { params: this.optionsPrimary ? this.optionsPrimary.params || {} : {} });
|
|
12271
|
+
}
|
|
12272
|
+
getSerializedPrimary() {
|
|
12273
|
+
return this.getPrimary().serialize();
|
|
12274
|
+
}
|
|
12275
|
+
getSecondary() {
|
|
12276
|
+
if (this.nameSecondary) {
|
|
12277
|
+
return new ImageIdWithOptions(this.nameSecondary, { params: this.optionsSecondary ? this.optionsSecondary.params || {} : {} });
|
|
12278
|
+
}
|
|
12279
|
+
return null;
|
|
12280
|
+
}
|
|
12281
|
+
static from(image) {
|
|
12282
|
+
return typeof image === 'string' ? ResolvedImage.build(image) : image;
|
|
12283
|
+
}
|
|
12284
|
+
static build(namePrimary, nameSecondary, optionsPrimary, optionsSecondary) {
|
|
11803
12285
|
if (!namePrimary)
|
|
11804
12286
|
return null;
|
|
11805
12287
|
return new ResolvedImage({
|
|
11806
12288
|
namePrimary,
|
|
11807
12289
|
nameSecondary,
|
|
12290
|
+
optionsPrimary,
|
|
12291
|
+
optionsSecondary,
|
|
11808
12292
|
available: false
|
|
11809
12293
|
});
|
|
11810
12294
|
}
|
|
11811
|
-
serialize() {
|
|
11812
|
-
if (this.nameSecondary) {
|
|
11813
|
-
return [
|
|
11814
|
-
'image',
|
|
11815
|
-
this.namePrimary,
|
|
11816
|
-
this.nameSecondary
|
|
11817
|
-
];
|
|
11818
|
-
}
|
|
11819
|
-
return [
|
|
11820
|
-
'image',
|
|
11821
|
-
this.namePrimary
|
|
11822
|
-
];
|
|
11823
|
-
}
|
|
11824
12295
|
}
|
|
11825
12296
|
|
|
11826
12297
|
function validateRGBA(r, g, b, a) {
|
|
@@ -11961,7 +12432,9 @@ function toString(value) {
|
|
|
11961
12432
|
return '';
|
|
11962
12433
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
11963
12434
|
return String(value);
|
|
11964
|
-
} else if (value instanceof Color
|
|
12435
|
+
} else if (value instanceof Color) {
|
|
12436
|
+
return value.toStringPremultipliedAlpha();
|
|
12437
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
11965
12438
|
return value.toString();
|
|
11966
12439
|
} else {
|
|
11967
12440
|
return JSON.stringify(value);
|
|
@@ -12210,29 +12683,114 @@ class FormatExpression {
|
|
|
12210
12683
|
}
|
|
12211
12684
|
}
|
|
12212
12685
|
|
|
12686
|
+
function isImageOptions(value) {
|
|
12687
|
+
if (typeof value !== 'string' && !isExpression(value)) {
|
|
12688
|
+
return true;
|
|
12689
|
+
}
|
|
12690
|
+
return false;
|
|
12691
|
+
}
|
|
12213
12692
|
class ImageExpression {
|
|
12214
|
-
constructor(inputPrimary, inputSecondary) {
|
|
12693
|
+
constructor(inputPrimary, inputSecondary, inputPrimaryParams, inputSecondaryParams) {
|
|
12694
|
+
this._imageWarnHistory = {};
|
|
12215
12695
|
this.type = ResolvedImageType;
|
|
12216
12696
|
this.inputPrimary = inputPrimary;
|
|
12217
12697
|
this.inputSecondary = inputSecondary;
|
|
12698
|
+
this.inputPrimaryParams = inputPrimaryParams;
|
|
12699
|
+
this.inputSecondaryParams = inputSecondaryParams;
|
|
12218
12700
|
}
|
|
12219
12701
|
static parse(args, context) {
|
|
12220
12702
|
if (args.length < 2) {
|
|
12221
12703
|
return context.error(`Expected two or more arguments.`);
|
|
12222
12704
|
}
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12705
|
+
let nextArgId = 1;
|
|
12706
|
+
const imageExpression = [];
|
|
12707
|
+
function tryParseImage() {
|
|
12708
|
+
if (nextArgId < args.length) {
|
|
12709
|
+
const imageName = context.parse(args[nextArgId], nextArgId++, StringType);
|
|
12710
|
+
if (!imageName) {
|
|
12711
|
+
context.error(imageExpression.length ? `Secondary image variant is not a string.` : `No image name provided.`);
|
|
12712
|
+
return false;
|
|
12713
|
+
}
|
|
12714
|
+
imageExpression.push({
|
|
12715
|
+
image: imageName,
|
|
12716
|
+
options: void 0
|
|
12717
|
+
});
|
|
12718
|
+
return true;
|
|
12719
|
+
}
|
|
12720
|
+
return true;
|
|
12721
|
+
}
|
|
12722
|
+
function tryParseOptions() {
|
|
12723
|
+
if (nextArgId < args.length) {
|
|
12724
|
+
if (!isImageOptions(args[nextArgId])) {
|
|
12725
|
+
return true;
|
|
12726
|
+
}
|
|
12727
|
+
const params = args[nextArgId].params;
|
|
12728
|
+
const optionsContext = context.concat(nextArgId);
|
|
12729
|
+
if (!params) {
|
|
12730
|
+
nextArgId++;
|
|
12731
|
+
return true;
|
|
12732
|
+
}
|
|
12733
|
+
if (typeof params !== 'object' || params.constructor !== Object) {
|
|
12734
|
+
optionsContext.error(`Image options "params" should be an object`);
|
|
12735
|
+
return false;
|
|
12736
|
+
}
|
|
12737
|
+
const parsed = {};
|
|
12738
|
+
const childContext = optionsContext.concat(void 0, 'params');
|
|
12739
|
+
for (const key in params) {
|
|
12740
|
+
if (!key) {
|
|
12741
|
+
childContext.error(`Image parameter name should be non-empty`);
|
|
12742
|
+
return false;
|
|
12743
|
+
}
|
|
12744
|
+
const value = childContext.concat(void 0, key).parse(params[key], void 0, ColorType, void 0, { typeAnnotation: 'coerce' });
|
|
12745
|
+
if (!value) {
|
|
12746
|
+
return false;
|
|
12747
|
+
}
|
|
12748
|
+
parsed[key] = value;
|
|
12749
|
+
}
|
|
12750
|
+
imageExpression[imageExpression.length - 1].options = parsed;
|
|
12751
|
+
nextArgId++;
|
|
12752
|
+
return true;
|
|
12753
|
+
}
|
|
12754
|
+
return true;
|
|
12755
|
+
}
|
|
12756
|
+
for (let i = 0; i < 2; i++) {
|
|
12757
|
+
if (!tryParseImage() || !tryParseOptions()) {
|
|
12758
|
+
return;
|
|
12759
|
+
}
|
|
12760
|
+
}
|
|
12761
|
+
return new ImageExpression(imageExpression[0].image, imageExpression[1] ? imageExpression[1].image : void 0, imageExpression[0].options, imageExpression[1] ? imageExpression[1].options : void 0);
|
|
12762
|
+
}
|
|
12763
|
+
evaluateParams(ctx, params) {
|
|
12764
|
+
const result = {};
|
|
12765
|
+
if (params) {
|
|
12766
|
+
for (const key in params) {
|
|
12767
|
+
if (params[key]) {
|
|
12768
|
+
try {
|
|
12769
|
+
const color = params[key].evaluate(ctx);
|
|
12770
|
+
const msg = `Ignoring image parameter "${ key }" with semi-transparent color ${ color.toString() }`;
|
|
12771
|
+
if (color.a !== 1) {
|
|
12772
|
+
if (!this._imageWarnHistory[msg]) {
|
|
12773
|
+
console.warn(msg);
|
|
12774
|
+
this._imageWarnHistory[msg] = true;
|
|
12775
|
+
}
|
|
12776
|
+
continue;
|
|
12777
|
+
}
|
|
12778
|
+
result[key] = color;
|
|
12779
|
+
} catch (err) {
|
|
12780
|
+
continue;
|
|
12781
|
+
}
|
|
12782
|
+
}
|
|
12783
|
+
}
|
|
12784
|
+
} else {
|
|
12785
|
+
return void 0;
|
|
12786
|
+
}
|
|
12787
|
+
if (Object.keys(result).length === 0) {
|
|
12788
|
+
return void 0;
|
|
12228
12789
|
}
|
|
12229
|
-
|
|
12230
|
-
if (!nameSecondary)
|
|
12231
|
-
return context.error(`Secondary image variant is not a string.`);
|
|
12232
|
-
return new ImageExpression(namePrimary, nameSecondary);
|
|
12790
|
+
return { params: result };
|
|
12233
12791
|
}
|
|
12234
12792
|
evaluate(ctx) {
|
|
12235
|
-
const value = ResolvedImage.
|
|
12793
|
+
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);
|
|
12236
12794
|
if (value && ctx.availableImages) {
|
|
12237
12795
|
value.available = ctx.availableImages.indexOf(value.namePrimary) > -1;
|
|
12238
12796
|
if (value.nameSecondary && value.available && ctx.availableImages) {
|
|
@@ -12243,25 +12801,55 @@ class ImageExpression {
|
|
|
12243
12801
|
}
|
|
12244
12802
|
eachChild(fn) {
|
|
12245
12803
|
fn(this.inputPrimary);
|
|
12804
|
+
if (this.inputPrimaryParams) {
|
|
12805
|
+
for (const key in this.inputPrimaryParams) {
|
|
12806
|
+
if (this.inputPrimaryParams[key]) {
|
|
12807
|
+
fn(this.inputPrimaryParams[key]);
|
|
12808
|
+
}
|
|
12809
|
+
}
|
|
12810
|
+
}
|
|
12246
12811
|
if (this.inputSecondary) {
|
|
12247
12812
|
fn(this.inputSecondary);
|
|
12813
|
+
if (this.inputSecondaryParams) {
|
|
12814
|
+
for (const key in this.inputSecondaryParams) {
|
|
12815
|
+
if (this.inputSecondaryParams[key]) {
|
|
12816
|
+
fn(this.inputSecondaryParams[key]);
|
|
12817
|
+
}
|
|
12818
|
+
}
|
|
12819
|
+
}
|
|
12248
12820
|
}
|
|
12249
12821
|
}
|
|
12250
12822
|
outputDefined() {
|
|
12251
12823
|
return false;
|
|
12252
12824
|
}
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12825
|
+
serializeParams(params) {
|
|
12826
|
+
const result = {};
|
|
12827
|
+
if (params) {
|
|
12828
|
+
for (const key in params) {
|
|
12829
|
+
if (params[key]) {
|
|
12830
|
+
result[key] = params[key].serialize();
|
|
12831
|
+
}
|
|
12832
|
+
}
|
|
12833
|
+
} else {
|
|
12834
|
+
return void 0;
|
|
12260
12835
|
}
|
|
12261
|
-
return
|
|
12836
|
+
return { params: result };
|
|
12837
|
+
}
|
|
12838
|
+
serialize() {
|
|
12839
|
+
const serialized = [
|
|
12262
12840
|
'image',
|
|
12263
12841
|
this.inputPrimary.serialize()
|
|
12264
12842
|
];
|
|
12843
|
+
if (this.inputPrimaryParams) {
|
|
12844
|
+
serialized.push(this.serializeParams(this.inputPrimaryParams));
|
|
12845
|
+
}
|
|
12846
|
+
if (this.inputSecondary) {
|
|
12847
|
+
serialized.push(this.inputSecondary.serialize());
|
|
12848
|
+
if (this.inputSecondaryParams) {
|
|
12849
|
+
serialized.push(this.serializeParams(this.inputSecondaryParams));
|
|
12850
|
+
}
|
|
12851
|
+
}
|
|
12852
|
+
return serialized;
|
|
12265
12853
|
}
|
|
12266
12854
|
}
|
|
12267
12855
|
|
|
@@ -12389,7 +12977,7 @@ class Coercion {
|
|
|
12389
12977
|
} else if (this.type.kind === 'formatted') {
|
|
12390
12978
|
return Formatted.fromString(toString(this.args[0].evaluate(ctx)));
|
|
12391
12979
|
} else if (this.type.kind === 'resolvedImage') {
|
|
12392
|
-
return ResolvedImage.
|
|
12980
|
+
return ResolvedImage.build(toString(this.args[0].evaluate(ctx)));
|
|
12393
12981
|
} else if (this.type.kind === 'array') {
|
|
12394
12982
|
return this.args.map(arg => {
|
|
12395
12983
|
return arg.evaluate(ctx);
|
|
@@ -14143,7 +14731,7 @@ function coerceValue(type, value) {
|
|
|
14143
14731
|
return Formatted.fromString(toString(value));
|
|
14144
14732
|
}
|
|
14145
14733
|
case 'resolvedImage': {
|
|
14146
|
-
return ResolvedImage.
|
|
14734
|
+
return ResolvedImage.build(toString(value));
|
|
14147
14735
|
}
|
|
14148
14736
|
}
|
|
14149
14737
|
return value;
|
|
@@ -14801,11 +15389,12 @@ var colorSpaces = /*#__PURE__*/Object.freeze({
|
|
|
14801
15389
|
});
|
|
14802
15390
|
|
|
14803
15391
|
class Interpolate {
|
|
14804
|
-
constructor(type, operator, interpolation, input, stops) {
|
|
15392
|
+
constructor(type, operator, interpolation, input, dynamicStops, stops) {
|
|
14805
15393
|
this.type = type;
|
|
14806
15394
|
this.operator = operator;
|
|
14807
15395
|
this.interpolation = interpolation;
|
|
14808
15396
|
this.input = input;
|
|
15397
|
+
this.dynamicStops = dynamicStops;
|
|
14809
15398
|
this.labels = [];
|
|
14810
15399
|
this.outputs = [];
|
|
14811
15400
|
for (const [label, expression] of stops) {
|
|
@@ -14853,10 +15442,10 @@ class Interpolate {
|
|
|
14853
15442
|
} else {
|
|
14854
15443
|
return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0);
|
|
14855
15444
|
}
|
|
14856
|
-
if (args.length - 1 <
|
|
14857
|
-
return context.error(`Expected at least
|
|
15445
|
+
if (args.length - 1 < 3) {
|
|
15446
|
+
return context.error(`Expected at least 3 arguments, but found only ${ args.length - 1 }.`);
|
|
14858
15447
|
}
|
|
14859
|
-
if ((args.length - 1) % 2 !== 0) {
|
|
15448
|
+
if (args.length - 1 > 3 && (args.length - 1) % 2 !== 0) {
|
|
14860
15449
|
return context.error(`Expected an even number of arguments.`);
|
|
14861
15450
|
}
|
|
14862
15451
|
input = context.parse(input, 2, NumberType);
|
|
@@ -14869,6 +15458,12 @@ class Interpolate {
|
|
|
14869
15458
|
} else if (context.expectedType && context.expectedType.kind !== 'value') {
|
|
14870
15459
|
outputType = context.expectedType;
|
|
14871
15460
|
}
|
|
15461
|
+
if (args.length - 1 === 3) {
|
|
15462
|
+
const dynamicStops = context.parse(rest[0], 3, ValueType);
|
|
15463
|
+
if (!dynamicStops)
|
|
15464
|
+
return null;
|
|
15465
|
+
return new Interpolate(outputType, operator, interpolation, input, dynamicStops, stops);
|
|
15466
|
+
}
|
|
14872
15467
|
for (let i = 0; i < rest.length; i += 2) {
|
|
14873
15468
|
const label = rest[i];
|
|
14874
15469
|
const value = rest[i + 1];
|
|
@@ -14892,11 +15487,34 @@ class Interpolate {
|
|
|
14892
15487
|
if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
|
|
14893
15488
|
return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`);
|
|
14894
15489
|
}
|
|
14895
|
-
return new Interpolate(outputType, operator, interpolation, input, stops);
|
|
15490
|
+
return new Interpolate(outputType, operator, interpolation, input, null, stops);
|
|
14896
15491
|
}
|
|
14897
15492
|
evaluate(ctx) {
|
|
14898
|
-
|
|
14899
|
-
|
|
15493
|
+
let labels = this.labels;
|
|
15494
|
+
let outputs = this.outputs;
|
|
15495
|
+
if (this.dynamicStops) {
|
|
15496
|
+
const dynamicStopsValue = this.dynamicStops.evaluate(ctx);
|
|
15497
|
+
if (dynamicStopsValue.length % 2 !== 0) {
|
|
15498
|
+
throw new RuntimeError('Expected an even number of arguments.');
|
|
15499
|
+
}
|
|
15500
|
+
labels = [];
|
|
15501
|
+
outputs = [];
|
|
15502
|
+
for (let i = 0; i < dynamicStopsValue.length; i += 2) {
|
|
15503
|
+
const label = dynamicStopsValue[i];
|
|
15504
|
+
const output = new Literal(NumberType, dynamicStopsValue[i + 1]);
|
|
15505
|
+
if (typeof label !== 'number') {
|
|
15506
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.');
|
|
15507
|
+
}
|
|
15508
|
+
if (labels.length && labels[labels.length - 1] >= label) {
|
|
15509
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');
|
|
15510
|
+
}
|
|
15511
|
+
labels.push(label);
|
|
15512
|
+
outputs.push(output);
|
|
15513
|
+
}
|
|
15514
|
+
if (labels.length === 0) {
|
|
15515
|
+
throw new RuntimeError('Expected at least one input/output pair.');
|
|
15516
|
+
}
|
|
15517
|
+
}
|
|
14900
15518
|
if (labels.length === 1) {
|
|
14901
15519
|
return outputs[0].evaluate(ctx);
|
|
14902
15520
|
}
|
|
@@ -14952,8 +15570,12 @@ class Interpolate {
|
|
|
14952
15570
|
interpolation,
|
|
14953
15571
|
this.input.serialize()
|
|
14954
15572
|
];
|
|
14955
|
-
|
|
14956
|
-
serialized.push(this.
|
|
15573
|
+
if (this.dynamicStops) {
|
|
15574
|
+
serialized.push(this.dynamicStops.serialize());
|
|
15575
|
+
} else {
|
|
15576
|
+
for (let i = 0; i < this.labels.length; i++) {
|
|
15577
|
+
serialized.push(this.labels[i], this.outputs[i].serialize());
|
|
15578
|
+
}
|
|
14957
15579
|
}
|
|
14958
15580
|
return serialized;
|
|
14959
15581
|
}
|
|
@@ -15941,6 +16563,13 @@ CompoundExpression.register(expressions, {
|
|
|
15941
16563
|
return v.evaluate(ctx).toRenderColor(null).toArray();
|
|
15942
16564
|
}
|
|
15943
16565
|
],
|
|
16566
|
+
'to-hsla': [
|
|
16567
|
+
array$1(NumberType, 4),
|
|
16568
|
+
[ColorType],
|
|
16569
|
+
(ctx, [v]) => {
|
|
16570
|
+
return v.evaluate(ctx).toRenderColor(null).toHslaArray();
|
|
16571
|
+
}
|
|
16572
|
+
],
|
|
15944
16573
|
'rgb': [
|
|
15945
16574
|
ColorType,
|
|
15946
16575
|
[
|
|
@@ -16516,6 +17145,9 @@ function supportsLightExpression(spec) {
|
|
|
16516
17145
|
function supportsZoomExpression(spec) {
|
|
16517
17146
|
return expressionHasParameter(spec.expression, 'zoom');
|
|
16518
17147
|
}
|
|
17148
|
+
function supportsLineProgressExpression(spec) {
|
|
17149
|
+
return expressionHasParameter(spec.expression, 'line-progress');
|
|
17150
|
+
}
|
|
16519
17151
|
function supportsInterpolation(spec) {
|
|
16520
17152
|
return !!spec.expression && spec.expression.interpolated;
|
|
16521
17153
|
}
|
|
@@ -16702,7 +17334,7 @@ function evaluateIdentityFunction(parameters, propertySpec, input) {
|
|
|
16702
17334
|
} else if (propertySpec.type === 'formatted') {
|
|
16703
17335
|
input = Formatted.fromString(input.toString());
|
|
16704
17336
|
} else if (propertySpec.type === 'resolvedImage') {
|
|
16705
|
-
input = ResolvedImage.
|
|
17337
|
+
input = ResolvedImage.build(input.toString());
|
|
16706
17338
|
} else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
|
|
16707
17339
|
input = void 0;
|
|
16708
17340
|
}
|
|
@@ -16727,6 +17359,7 @@ class StyleExpression {
|
|
|
16727
17359
|
this._evaluator = new EvaluationContext(scope, options);
|
|
16728
17360
|
this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;
|
|
16729
17361
|
this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;
|
|
17362
|
+
this.configDependencies = getConfigDependencies(expression);
|
|
16730
17363
|
}
|
|
16731
17364
|
evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
|
|
16732
17365
|
this._evaluator.globals = globals;
|
|
@@ -16780,10 +17413,11 @@ function createExpression(expression, propertySpec, scope, options) {
|
|
|
16780
17413
|
return success(new StyleExpression(parsed, propertySpec, scope, options));
|
|
16781
17414
|
}
|
|
16782
17415
|
class ZoomConstantExpression {
|
|
16783
|
-
constructor(kind, expression, isLightConstant) {
|
|
17416
|
+
constructor(kind, expression, isLightConstant, isLineProgressConstant) {
|
|
16784
17417
|
this.kind = kind;
|
|
16785
17418
|
this._styleExpression = expression;
|
|
16786
17419
|
this.isLightConstant = isLightConstant;
|
|
17420
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16787
17421
|
this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
|
|
16788
17422
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16789
17423
|
}
|
|
@@ -16795,12 +17429,13 @@ class ZoomConstantExpression {
|
|
|
16795
17429
|
}
|
|
16796
17430
|
}
|
|
16797
17431
|
class ZoomDependentExpression {
|
|
16798
|
-
constructor(kind, expression, zoomStops, interpolationType, isLightConstant) {
|
|
17432
|
+
constructor(kind, expression, zoomStops, interpolationType, isLightConstant, isLineProgressConstant) {
|
|
16799
17433
|
this.kind = kind;
|
|
16800
17434
|
this.zoomStops = zoomStops;
|
|
16801
17435
|
this._styleExpression = expression;
|
|
16802
17436
|
this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
|
|
16803
17437
|
this.isLightConstant = isLightConstant;
|
|
17438
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16804
17439
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16805
17440
|
this.interpolationType = interpolationType;
|
|
16806
17441
|
}
|
|
@@ -16840,6 +17475,10 @@ function createPropertyExpression(expression, propertySpec, scope, options) {
|
|
|
16840
17475
|
if (!isLightConstant && !supportsLightExpression(propertySpec)) {
|
|
16841
17476
|
return error([new ParsingError$1('', 'measure-light expression not supported')]);
|
|
16842
17477
|
}
|
|
17478
|
+
const isLineProgressConstant = isGlobalPropertyConstant(parsed, ['line-progress']);
|
|
17479
|
+
if (!isLineProgressConstant && !supportsLineProgressExpression(propertySpec)) {
|
|
17480
|
+
return error([new ParsingError$1('', 'line-progress expression not supported')]);
|
|
17481
|
+
}
|
|
16843
17482
|
const canRelaxZoomRestriction = propertySpec.expression && propertySpec.expression.relaxZoomRestriction;
|
|
16844
17483
|
const zoomCurve = findZoomCurve(parsed);
|
|
16845
17484
|
if (!zoomCurve && !isZoomConstant && !canRelaxZoomRestriction) {
|
|
@@ -16850,14 +17489,14 @@ function createPropertyExpression(expression, propertySpec, scope, options) {
|
|
|
16850
17489
|
return error([new ParsingError$1('', '"interpolate" expressions cannot be used with this property')]);
|
|
16851
17490
|
}
|
|
16852
17491
|
if (!zoomCurve) {
|
|
16853
|
-
return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16854
|
-
new ZoomConstantExpression('constant', expression.value, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16855
|
-
new ZoomConstantExpression('source', expression.value, isLightConstant));
|
|
17492
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17493
|
+
new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17494
|
+
new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
|
|
16856
17495
|
}
|
|
16857
17496
|
const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
|
|
16858
|
-
return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16859
|
-
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16860
|
-
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant));
|
|
17497
|
+
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17498
|
+
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17499
|
+
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
|
|
16861
17500
|
}
|
|
16862
17501
|
class StylePropertyFunction {
|
|
16863
17502
|
constructor(parameters, specification) {
|
|
@@ -17328,13 +17967,16 @@ Filter Expression:
|
|
|
17328
17967
|
${ JSON.stringify(filterExp, null, 2) }
|
|
17329
17968
|
`);
|
|
17330
17969
|
}
|
|
17331
|
-
const filterSpec = v8[`filter_${ layerType }`];
|
|
17332
|
-
const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
|
|
17333
17970
|
let filterFunc = null;
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17971
|
+
let filterSpec = null;
|
|
17972
|
+
if (layerType !== 'background' && layerType !== 'sky' && layerType !== 'slot') {
|
|
17973
|
+
filterSpec = v8[`filter_${ layerType }`];
|
|
17974
|
+
const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
|
|
17975
|
+
if (compiledStaticFilter.result === 'error') {
|
|
17976
|
+
throw new Error(compiledStaticFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', '));
|
|
17977
|
+
} else {
|
|
17978
|
+
filterFunc = (globalProperties, feature, canonical) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);
|
|
17979
|
+
}
|
|
17338
17980
|
}
|
|
17339
17981
|
let dynamicFilterFunc = null;
|
|
17340
17982
|
let needFeature = null;
|
|
@@ -17976,6 +18618,14 @@ const operations = {
|
|
|
17976
18618
|
*/
|
|
17977
18619
|
setFog: 'setFog',
|
|
17978
18620
|
/*
|
|
18621
|
+
* { command: 'setSnow', args: [snowProperties] }
|
|
18622
|
+
*/
|
|
18623
|
+
setSnow: 'setSnow',
|
|
18624
|
+
/*
|
|
18625
|
+
* { command: 'setRain', args: [rainProperties] }
|
|
18626
|
+
*/
|
|
18627
|
+
setRain: 'setRain',
|
|
18628
|
+
/*
|
|
17979
18629
|
* { command: 'setCamera', args: [cameraProperties] }
|
|
17980
18630
|
*/
|
|
17981
18631
|
setCamera: 'setCamera',
|
|
@@ -18376,6 +19026,18 @@ function diffStyles(before, after) {
|
|
|
18376
19026
|
args: [after.fog]
|
|
18377
19027
|
});
|
|
18378
19028
|
}
|
|
19029
|
+
if (!deepEqual(before.snow, after.snow)) {
|
|
19030
|
+
commands.push({
|
|
19031
|
+
command: operations.setSnow,
|
|
19032
|
+
args: [after.snow]
|
|
19033
|
+
});
|
|
19034
|
+
}
|
|
19035
|
+
if (!deepEqual(before.rain, after.rain)) {
|
|
19036
|
+
commands.push({
|
|
19037
|
+
command: operations.setRain,
|
|
19038
|
+
args: [after.rain]
|
|
19039
|
+
});
|
|
19040
|
+
}
|
|
18379
19041
|
if (!deepEqual(before.projection, after.projection)) {
|
|
18380
19042
|
commands.push({
|
|
18381
19043
|
command: operations.setProjection,
|
|
@@ -18987,6 +19649,16 @@ function validateProperty(options, propertyType) {
|
|
|
18987
19649
|
const layerSpec = styleSpec[`${ propertyType }_${ options.layerType }`];
|
|
18988
19650
|
if (!layerSpec)
|
|
18989
19651
|
return [];
|
|
19652
|
+
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
19653
|
+
if (propertyType === 'paint' && useThemeMatch && layerSpec[useThemeMatch[1]]) {
|
|
19654
|
+
return validate({
|
|
19655
|
+
key,
|
|
19656
|
+
value,
|
|
19657
|
+
valueSpec: { type: 'string' },
|
|
19658
|
+
style,
|
|
19659
|
+
styleSpec
|
|
19660
|
+
});
|
|
19661
|
+
}
|
|
18990
19662
|
const transitionMatch = propertyKey.match(/^(.*)-transition$/);
|
|
18991
19663
|
if (propertyType === 'paint' && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) {
|
|
18992
19664
|
return validate({
|
|
@@ -19361,7 +20033,16 @@ function validateLight(options) {
|
|
|
19361
20033
|
}
|
|
19362
20034
|
for (const key in light) {
|
|
19363
20035
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19364
|
-
|
|
20036
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20037
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20038
|
+
errors = errors.concat(validate({
|
|
20039
|
+
key,
|
|
20040
|
+
value: light[key],
|
|
20041
|
+
valueSpec: { type: 'string' },
|
|
20042
|
+
style,
|
|
20043
|
+
styleSpec
|
|
20044
|
+
}));
|
|
20045
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19365
20046
|
errors = errors.concat(validate({
|
|
19366
20047
|
key,
|
|
19367
20048
|
value: light[key],
|
|
@@ -19447,7 +20128,16 @@ function validateLights(options) {
|
|
|
19447
20128
|
}
|
|
19448
20129
|
} else {
|
|
19449
20130
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19450
|
-
|
|
20131
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20132
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20133
|
+
errors = errors.concat(validate({
|
|
20134
|
+
key: key2,
|
|
20135
|
+
value: light[key2],
|
|
20136
|
+
valueSpec: { type: 'string' },
|
|
20137
|
+
style,
|
|
20138
|
+
styleSpec
|
|
20139
|
+
}));
|
|
20140
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19451
20141
|
errors = errors.concat(validate({
|
|
19452
20142
|
key: key2,
|
|
19453
20143
|
value: light[key2],
|
|
@@ -19489,7 +20179,16 @@ function validateTerrain(options) {
|
|
|
19489
20179
|
}
|
|
19490
20180
|
for (const key2 in terrain) {
|
|
19491
20181
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19492
|
-
|
|
20182
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20183
|
+
if (useThemeMatch && terrainSpec[useThemeMatch[1]]) {
|
|
20184
|
+
errors = errors.concat(validate({
|
|
20185
|
+
key: key2,
|
|
20186
|
+
value: terrain[key2],
|
|
20187
|
+
valueSpec: { type: 'string' },
|
|
20188
|
+
style,
|
|
20189
|
+
styleSpec
|
|
20190
|
+
}));
|
|
20191
|
+
} else if (transitionMatch && terrainSpec[transitionMatch[1]] && terrainSpec[transitionMatch[1]].transition) {
|
|
19493
20192
|
errors = errors.concat(validate({
|
|
19494
20193
|
key: key2,
|
|
19495
20194
|
value: terrain[key2],
|
|
@@ -19538,7 +20237,16 @@ function validateFog(options) {
|
|
|
19538
20237
|
}
|
|
19539
20238
|
for (const key in fog) {
|
|
19540
20239
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19541
|
-
|
|
20240
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20241
|
+
if (useThemeMatch && fogSpec[useThemeMatch[1]]) {
|
|
20242
|
+
errors = errors.concat(validate({
|
|
20243
|
+
key,
|
|
20244
|
+
value: fog[key],
|
|
20245
|
+
valueSpec: { type: 'string' },
|
|
20246
|
+
style,
|
|
20247
|
+
styleSpec
|
|
20248
|
+
}));
|
|
20249
|
+
} else if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
|
|
19542
20250
|
errors = errors.concat(validate({
|
|
19543
20251
|
key,
|
|
19544
20252
|
value: fog[key],
|