@mapbox/mapbox-gl-style-spec 14.8.0 → 14.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/diff.ts +16 -0
- package/dist/index.cjs +807 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +162 -11
- package/dist/index.es.js +807 -130
- 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 +12 -6
- 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 +1 -0
- package/function/index.ts +1 -1
- package/group_by_layout.ts +35 -3
- package/package.json +1 -1
- package/reference/v8.json +357 -70
- package/types.ts +118 -9
- package/util/color.ts +62 -1
- 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",
|
|
@@ -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",
|
|
@@ -1503,8 +1540,7 @@ var layout_clip = {
|
|
|
1503
1540
|
expression: {
|
|
1504
1541
|
interpolated: false
|
|
1505
1542
|
},
|
|
1506
|
-
"property-type": "data-constant"
|
|
1507
|
-
experimental: true
|
|
1543
|
+
"property-type": "data-constant"
|
|
1508
1544
|
},
|
|
1509
1545
|
"clip-layer-scope": {
|
|
1510
1546
|
type: "array",
|
|
@@ -1522,8 +1558,7 @@ var layout_clip = {
|
|
|
1522
1558
|
expression: {
|
|
1523
1559
|
interpolated: false
|
|
1524
1560
|
},
|
|
1525
|
-
"property-type": "data-constant"
|
|
1526
|
-
experimental: true
|
|
1561
|
+
"property-type": "data-constant"
|
|
1527
1562
|
}
|
|
1528
1563
|
};
|
|
1529
1564
|
var layout_fill = {
|
|
@@ -1956,6 +1991,36 @@ var layout_line = {
|
|
|
1956
1991
|
interpolated: false
|
|
1957
1992
|
},
|
|
1958
1993
|
"property-type": "constant"
|
|
1994
|
+
},
|
|
1995
|
+
"line-width-unit": {
|
|
1996
|
+
type: "enum",
|
|
1997
|
+
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.",
|
|
1998
|
+
values: {
|
|
1999
|
+
pixels: {
|
|
2000
|
+
doc: "Width is rendered in pixels."
|
|
2001
|
+
},
|
|
2002
|
+
meters: {
|
|
2003
|
+
doc: "Width is rendered in meters."
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2006
|
+
"default": "pixels",
|
|
2007
|
+
experimental: true,
|
|
2008
|
+
"private": true,
|
|
2009
|
+
transition: false,
|
|
2010
|
+
"sdk-support": {
|
|
2011
|
+
"basic functionality": {
|
|
2012
|
+
js: "3.9.0",
|
|
2013
|
+
android: "11.9.0",
|
|
2014
|
+
ios: "11.9.0"
|
|
2015
|
+
}
|
|
2016
|
+
},
|
|
2017
|
+
expression: {
|
|
2018
|
+
interpolated: false,
|
|
2019
|
+
parameters: [
|
|
2020
|
+
"zoom"
|
|
2021
|
+
]
|
|
2022
|
+
},
|
|
2023
|
+
"property-type": "data-constant"
|
|
1959
2024
|
}
|
|
1960
2025
|
};
|
|
1961
2026
|
var layout_symbol = {
|
|
@@ -2070,7 +2135,7 @@ var layout_symbol = {
|
|
|
2070
2135
|
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`."
|
|
2071
2136
|
},
|
|
2072
2137
|
"viewport-y": {
|
|
2073
|
-
doc: "Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap
|
|
2138
|
+
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`."
|
|
2074
2139
|
},
|
|
2075
2140
|
source: {
|
|
2076
2141
|
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."
|
|
@@ -2307,9 +2372,7 @@ var layout_symbol = {
|
|
|
2307
2372
|
},
|
|
2308
2373
|
"sdk-support": {
|
|
2309
2374
|
"basic functionality": {
|
|
2310
|
-
js: "3.8.0"
|
|
2311
|
-
android: "11.8.0",
|
|
2312
|
-
ios: "11.8.0"
|
|
2375
|
+
js: "3.8.0"
|
|
2313
2376
|
}
|
|
2314
2377
|
},
|
|
2315
2378
|
"property-type": "data-constant"
|
|
@@ -2821,9 +2884,7 @@ var layout_symbol = {
|
|
|
2821
2884
|
},
|
|
2822
2885
|
"sdk-support": {
|
|
2823
2886
|
"basic functionality": {
|
|
2824
|
-
js: "3.8.0"
|
|
2825
|
-
android: "11.8.0",
|
|
2826
|
-
ios: "11.8.0"
|
|
2887
|
+
js: "3.8.0"
|
|
2827
2888
|
}
|
|
2828
2889
|
},
|
|
2829
2890
|
"property-type": "data-constant"
|
|
@@ -4009,7 +4070,7 @@ var expression_name = {
|
|
|
4009
4070
|
}
|
|
4010
4071
|
},
|
|
4011
4072
|
image: {
|
|
4012
|
-
doc: "Returns a [`ResolvedImage`](/
|
|
4073
|
+
doc: "Returns a [`ResolvedImage`](/style-spec/reference/types/#resolvedimage) for use in [`icon-image`](/style-spec/reference/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression.\n\nA [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.\n\nEvery image name can be followed by an optional [`ImageOptions`](/style-spec/reference/types/#imageoptions) object, which will be used for vector images only.\n\nTo implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/style-spec/reference/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",
|
|
4013
4074
|
group: "Types",
|
|
4014
4075
|
"sdk-support": {
|
|
4015
4076
|
"basic functionality": {
|
|
@@ -4074,6 +4135,17 @@ var expression_name = {
|
|
|
4074
4135
|
}
|
|
4075
4136
|
}
|
|
4076
4137
|
},
|
|
4138
|
+
"to-hsla": {
|
|
4139
|
+
doc: "Returns a four-element array containing the input color's Hue, Saturation, Luminance and alpha components, in that order.",
|
|
4140
|
+
group: "Color",
|
|
4141
|
+
"sdk-support": {
|
|
4142
|
+
"basic functionality": {
|
|
4143
|
+
js: "3.9.0",
|
|
4144
|
+
android: "11.9.0",
|
|
4145
|
+
ios: "11.9.0"
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
},
|
|
4077
4149
|
"to-color": {
|
|
4078
4150
|
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.",
|
|
4079
4151
|
group: "Types",
|
|
@@ -4994,7 +5066,19 @@ var snow = {
|
|
|
4994
5066
|
density: {
|
|
4995
5067
|
type: "number",
|
|
4996
5068
|
"property-type": "data-constant",
|
|
4997
|
-
"default":
|
|
5069
|
+
"default": [
|
|
5070
|
+
"interpolate",
|
|
5071
|
+
[
|
|
5072
|
+
"linear"
|
|
5073
|
+
],
|
|
5074
|
+
[
|
|
5075
|
+
"zoom"
|
|
5076
|
+
],
|
|
5077
|
+
11,
|
|
5078
|
+
0,
|
|
5079
|
+
13,
|
|
5080
|
+
0.85
|
|
5081
|
+
],
|
|
4998
5082
|
minimum: 0,
|
|
4999
5083
|
maximum: 1,
|
|
5000
5084
|
experimental: true,
|
|
@@ -5007,11 +5091,11 @@ var snow = {
|
|
|
5007
5091
|
relaxZoomRestriction: true
|
|
5008
5092
|
},
|
|
5009
5093
|
transition: true,
|
|
5010
|
-
doc: "Snow particles density.",
|
|
5094
|
+
doc: "Snow particles density. Controls the overall particles number.",
|
|
5011
5095
|
"sdk-support": {
|
|
5012
5096
|
"basic functionality": {
|
|
5013
|
-
android: "11.
|
|
5014
|
-
ios: "11.
|
|
5097
|
+
android: "11.9.0",
|
|
5098
|
+
ios: "11.9.0"
|
|
5015
5099
|
}
|
|
5016
5100
|
}
|
|
5017
5101
|
},
|
|
@@ -5031,11 +5115,11 @@ var snow = {
|
|
|
5031
5115
|
relaxZoomRestriction: true
|
|
5032
5116
|
},
|
|
5033
5117
|
transition: true,
|
|
5034
|
-
doc: "Snow particles movement factor.",
|
|
5118
|
+
doc: "Snow particles movement factor. Controls the overall particles movement speed.",
|
|
5035
5119
|
"sdk-support": {
|
|
5036
5120
|
"basic functionality": {
|
|
5037
|
-
android: "11.
|
|
5038
|
-
ios: "11.
|
|
5121
|
+
android: "11.9.0",
|
|
5122
|
+
ios: "11.9.0"
|
|
5039
5123
|
}
|
|
5040
5124
|
}
|
|
5041
5125
|
},
|
|
@@ -5056,8 +5140,8 @@ var snow = {
|
|
|
5056
5140
|
doc: "Snow particles color.",
|
|
5057
5141
|
"sdk-support": {
|
|
5058
5142
|
"basic functionality": {
|
|
5059
|
-
android: "11.
|
|
5060
|
-
ios: "11.
|
|
5143
|
+
android: "11.9.0",
|
|
5144
|
+
ios: "11.9.0"
|
|
5061
5145
|
}
|
|
5062
5146
|
}
|
|
5063
5147
|
},
|
|
@@ -5080,15 +5164,27 @@ var snow = {
|
|
|
5080
5164
|
doc: "Snow particles opacity.",
|
|
5081
5165
|
"sdk-support": {
|
|
5082
5166
|
"basic functionality": {
|
|
5083
|
-
android: "11.
|
|
5084
|
-
ios: "11.
|
|
5167
|
+
android: "11.9.0",
|
|
5168
|
+
ios: "11.9.0"
|
|
5085
5169
|
}
|
|
5086
5170
|
}
|
|
5087
5171
|
},
|
|
5088
5172
|
vignette: {
|
|
5089
5173
|
type: "number",
|
|
5090
5174
|
"property-type": "data-constant",
|
|
5091
|
-
"default":
|
|
5175
|
+
"default": [
|
|
5176
|
+
"interpolate",
|
|
5177
|
+
[
|
|
5178
|
+
"linear"
|
|
5179
|
+
],
|
|
5180
|
+
[
|
|
5181
|
+
"zoom"
|
|
5182
|
+
],
|
|
5183
|
+
11,
|
|
5184
|
+
0,
|
|
5185
|
+
13,
|
|
5186
|
+
0.3
|
|
5187
|
+
],
|
|
5092
5188
|
minimum: 0,
|
|
5093
5189
|
maximum: 1,
|
|
5094
5190
|
experimental: true,
|
|
@@ -5101,18 +5197,40 @@ var snow = {
|
|
|
5101
5197
|
relaxZoomRestriction: true
|
|
5102
5198
|
},
|
|
5103
5199
|
transition: true,
|
|
5104
|
-
doc: "Snow vignette screen-space effect.",
|
|
5200
|
+
doc: "Snow vignette screen-space effect. Adds snow tint to screen corners",
|
|
5105
5201
|
"sdk-support": {
|
|
5106
5202
|
"basic functionality": {
|
|
5107
|
-
android: "11.
|
|
5108
|
-
ios: "11.
|
|
5203
|
+
android: "11.9.0",
|
|
5204
|
+
ios: "11.9.0"
|
|
5109
5205
|
}
|
|
5110
5206
|
}
|
|
5111
5207
|
},
|
|
5112
|
-
|
|
5208
|
+
"vignette-color": {
|
|
5209
|
+
type: "color",
|
|
5210
|
+
"property-type": "data-constant",
|
|
5211
|
+
"default": "#ffffff",
|
|
5212
|
+
experimental: true,
|
|
5213
|
+
expression: {
|
|
5214
|
+
interpolated: true,
|
|
5215
|
+
parameters: [
|
|
5216
|
+
"zoom",
|
|
5217
|
+
"measure-light"
|
|
5218
|
+
],
|
|
5219
|
+
relaxZoomRestriction: true
|
|
5220
|
+
},
|
|
5221
|
+
transition: true,
|
|
5222
|
+
doc: "Snow vignette screen-space corners tint color.",
|
|
5223
|
+
"sdk-support": {
|
|
5224
|
+
"basic functionality": {
|
|
5225
|
+
android: "11.9.0",
|
|
5226
|
+
ios: "11.9.0"
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
},
|
|
5230
|
+
"center-thinning": {
|
|
5113
5231
|
type: "number",
|
|
5114
5232
|
"property-type": "data-constant",
|
|
5115
|
-
"default":
|
|
5233
|
+
"default": 0.4,
|
|
5116
5234
|
minimum: 0,
|
|
5117
5235
|
maximum: 1,
|
|
5118
5236
|
experimental: true,
|
|
@@ -5128,8 +5246,8 @@ var snow = {
|
|
|
5128
5246
|
doc: "Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5129
5247
|
"sdk-support": {
|
|
5130
5248
|
"basic functionality": {
|
|
5131
|
-
android: "11.
|
|
5132
|
-
ios: "11.
|
|
5249
|
+
android: "11.9.0",
|
|
5250
|
+
ios: "11.9.0"
|
|
5133
5251
|
}
|
|
5134
5252
|
}
|
|
5135
5253
|
},
|
|
@@ -5137,7 +5255,7 @@ var snow = {
|
|
|
5137
5255
|
type: "array",
|
|
5138
5256
|
"default": [
|
|
5139
5257
|
0,
|
|
5140
|
-
|
|
5258
|
+
50
|
|
5141
5259
|
],
|
|
5142
5260
|
minimum: 0,
|
|
5143
5261
|
maximum: 360,
|
|
@@ -5154,15 +5272,39 @@ var snow = {
|
|
|
5154
5272
|
],
|
|
5155
5273
|
relaxZoomRestriction: true
|
|
5156
5274
|
},
|
|
5157
|
-
doc: "Main snow particles direction.
|
|
5275
|
+
doc: "Main snow particles direction. Azimuth and polar angles",
|
|
5158
5276
|
example: [
|
|
5159
5277
|
0,
|
|
5160
5278
|
45
|
|
5161
5279
|
],
|
|
5162
5280
|
"sdk-support": {
|
|
5163
5281
|
"basic functionality": {
|
|
5164
|
-
android: "11.
|
|
5165
|
-
ios: "11.
|
|
5282
|
+
android: "11.9.0",
|
|
5283
|
+
ios: "11.9.0"
|
|
5284
|
+
}
|
|
5285
|
+
}
|
|
5286
|
+
},
|
|
5287
|
+
"flake-size": {
|
|
5288
|
+
type: "number",
|
|
5289
|
+
"property-type": "data-constant",
|
|
5290
|
+
"default": 0.71,
|
|
5291
|
+
minimum: 0,
|
|
5292
|
+
maximum: 5,
|
|
5293
|
+
experimental: true,
|
|
5294
|
+
expression: {
|
|
5295
|
+
interpolated: true,
|
|
5296
|
+
parameters: [
|
|
5297
|
+
"zoom",
|
|
5298
|
+
"measure-light"
|
|
5299
|
+
],
|
|
5300
|
+
relaxZoomRestriction: true
|
|
5301
|
+
},
|
|
5302
|
+
transition: true,
|
|
5303
|
+
doc: "Snow flake particle size. Correlates with individual particle screen size",
|
|
5304
|
+
"sdk-support": {
|
|
5305
|
+
"basic functionality": {
|
|
5306
|
+
android: "11.9.0",
|
|
5307
|
+
ios: "11.9.0"
|
|
5166
5308
|
}
|
|
5167
5309
|
}
|
|
5168
5310
|
}
|
|
@@ -5171,7 +5313,19 @@ var rain = {
|
|
|
5171
5313
|
density: {
|
|
5172
5314
|
type: "number",
|
|
5173
5315
|
"property-type": "data-constant",
|
|
5174
|
-
"default":
|
|
5316
|
+
"default": [
|
|
5317
|
+
"interpolate",
|
|
5318
|
+
[
|
|
5319
|
+
"linear"
|
|
5320
|
+
],
|
|
5321
|
+
[
|
|
5322
|
+
"zoom"
|
|
5323
|
+
],
|
|
5324
|
+
11,
|
|
5325
|
+
0,
|
|
5326
|
+
13,
|
|
5327
|
+
0.5
|
|
5328
|
+
],
|
|
5175
5329
|
minimum: 0,
|
|
5176
5330
|
maximum: 1,
|
|
5177
5331
|
experimental: true,
|
|
@@ -5184,11 +5338,11 @@ var rain = {
|
|
|
5184
5338
|
relaxZoomRestriction: true
|
|
5185
5339
|
},
|
|
5186
5340
|
transition: true,
|
|
5187
|
-
doc: "Rain particles density.",
|
|
5341
|
+
doc: "Rain particles density. Controls the overall screen density of the rain.",
|
|
5188
5342
|
"sdk-support": {
|
|
5189
5343
|
"basic functionality": {
|
|
5190
|
-
android: "11.
|
|
5191
|
-
ios: "11.
|
|
5344
|
+
android: "11.9.0",
|
|
5345
|
+
ios: "11.9.0"
|
|
5192
5346
|
}
|
|
5193
5347
|
}
|
|
5194
5348
|
},
|
|
@@ -5208,18 +5362,31 @@ var rain = {
|
|
|
5208
5362
|
relaxZoomRestriction: true
|
|
5209
5363
|
},
|
|
5210
5364
|
transition: true,
|
|
5211
|
-
doc: "Rain particles movement factor.",
|
|
5365
|
+
doc: "Rain particles movement factor. Controls the overall rain particles speed",
|
|
5212
5366
|
"sdk-support": {
|
|
5213
5367
|
"basic functionality": {
|
|
5214
|
-
android: "11.
|
|
5215
|
-
ios: "11.
|
|
5368
|
+
android: "11.9.0",
|
|
5369
|
+
ios: "11.9.0"
|
|
5216
5370
|
}
|
|
5217
5371
|
}
|
|
5218
5372
|
},
|
|
5219
5373
|
color: {
|
|
5220
5374
|
type: "color",
|
|
5221
5375
|
"property-type": "data-constant",
|
|
5222
|
-
"default":
|
|
5376
|
+
"default": [
|
|
5377
|
+
"interpolate",
|
|
5378
|
+
[
|
|
5379
|
+
"linear"
|
|
5380
|
+
],
|
|
5381
|
+
[
|
|
5382
|
+
"measure-light",
|
|
5383
|
+
"brightness"
|
|
5384
|
+
],
|
|
5385
|
+
0,
|
|
5386
|
+
"#03113d",
|
|
5387
|
+
0.3,
|
|
5388
|
+
"#a8adbc"
|
|
5389
|
+
],
|
|
5223
5390
|
experimental: true,
|
|
5224
5391
|
expression: {
|
|
5225
5392
|
interpolated: true,
|
|
@@ -5230,18 +5397,31 @@ var rain = {
|
|
|
5230
5397
|
relaxZoomRestriction: true
|
|
5231
5398
|
},
|
|
5232
5399
|
transition: true,
|
|
5233
|
-
doc: "",
|
|
5400
|
+
doc: "Individual rain particle dorplets color.",
|
|
5234
5401
|
"sdk-support": {
|
|
5235
5402
|
"basic functionality": {
|
|
5236
|
-
android: "11.
|
|
5237
|
-
ios: "11.
|
|
5403
|
+
android: "11.9.0",
|
|
5404
|
+
ios: "11.9.0"
|
|
5238
5405
|
}
|
|
5239
5406
|
}
|
|
5240
5407
|
},
|
|
5241
5408
|
opacity: {
|
|
5242
5409
|
type: "number",
|
|
5243
5410
|
"property-type": "data-constant",
|
|
5244
|
-
"default":
|
|
5411
|
+
"default": [
|
|
5412
|
+
"interpolate",
|
|
5413
|
+
[
|
|
5414
|
+
"linear"
|
|
5415
|
+
],
|
|
5416
|
+
[
|
|
5417
|
+
"measure-light",
|
|
5418
|
+
"brightness"
|
|
5419
|
+
],
|
|
5420
|
+
0,
|
|
5421
|
+
0.88,
|
|
5422
|
+
1,
|
|
5423
|
+
0.7
|
|
5424
|
+
],
|
|
5245
5425
|
minimum: 0,
|
|
5246
5426
|
maximum: 1,
|
|
5247
5427
|
experimental: true,
|
|
@@ -5257,15 +5437,27 @@ var rain = {
|
|
|
5257
5437
|
doc: "Rain particles opacity.",
|
|
5258
5438
|
"sdk-support": {
|
|
5259
5439
|
"basic functionality": {
|
|
5260
|
-
android: "11.
|
|
5261
|
-
ios: "11.
|
|
5440
|
+
android: "11.9.0",
|
|
5441
|
+
ios: "11.9.0"
|
|
5262
5442
|
}
|
|
5263
5443
|
}
|
|
5264
5444
|
},
|
|
5265
5445
|
vignette: {
|
|
5266
5446
|
type: "number",
|
|
5267
5447
|
"property-type": "data-constant",
|
|
5268
|
-
"default":
|
|
5448
|
+
"default": [
|
|
5449
|
+
"interpolate",
|
|
5450
|
+
[
|
|
5451
|
+
"linear"
|
|
5452
|
+
],
|
|
5453
|
+
[
|
|
5454
|
+
"zoom"
|
|
5455
|
+
],
|
|
5456
|
+
11,
|
|
5457
|
+
0,
|
|
5458
|
+
13,
|
|
5459
|
+
1
|
|
5460
|
+
],
|
|
5269
5461
|
minimum: 0,
|
|
5270
5462
|
maximum: 1,
|
|
5271
5463
|
experimental: true,
|
|
@@ -5278,18 +5470,53 @@ var rain = {
|
|
|
5278
5470
|
relaxZoomRestriction: true
|
|
5279
5471
|
},
|
|
5280
5472
|
transition: true,
|
|
5281
|
-
doc: "
|
|
5473
|
+
doc: "Screen-space vignette rain tinting effect intensity.",
|
|
5282
5474
|
"sdk-support": {
|
|
5283
5475
|
"basic functionality": {
|
|
5284
|
-
android: "11.
|
|
5285
|
-
ios: "11.
|
|
5476
|
+
android: "11.9.0",
|
|
5477
|
+
ios: "11.9.0"
|
|
5286
5478
|
}
|
|
5287
5479
|
}
|
|
5288
5480
|
},
|
|
5289
|
-
|
|
5481
|
+
"vignette-color": {
|
|
5482
|
+
type: "color",
|
|
5483
|
+
"property-type": "data-constant",
|
|
5484
|
+
"default": [
|
|
5485
|
+
"interpolate",
|
|
5486
|
+
[
|
|
5487
|
+
"linear"
|
|
5488
|
+
],
|
|
5489
|
+
[
|
|
5490
|
+
"measure-light",
|
|
5491
|
+
"brightness"
|
|
5492
|
+
],
|
|
5493
|
+
0,
|
|
5494
|
+
"#001736",
|
|
5495
|
+
0.3,
|
|
5496
|
+
"#464646"
|
|
5497
|
+
],
|
|
5498
|
+
experimental: true,
|
|
5499
|
+
expression: {
|
|
5500
|
+
interpolated: true,
|
|
5501
|
+
parameters: [
|
|
5502
|
+
"zoom",
|
|
5503
|
+
"measure-light"
|
|
5504
|
+
],
|
|
5505
|
+
relaxZoomRestriction: true
|
|
5506
|
+
},
|
|
5507
|
+
transition: true,
|
|
5508
|
+
doc: "Rain vignette screen-space corners tint color.",
|
|
5509
|
+
"sdk-support": {
|
|
5510
|
+
"basic functionality": {
|
|
5511
|
+
android: "11.9.0",
|
|
5512
|
+
ios: "11.9.0"
|
|
5513
|
+
}
|
|
5514
|
+
}
|
|
5515
|
+
},
|
|
5516
|
+
"center-thinning": {
|
|
5290
5517
|
type: "number",
|
|
5291
5518
|
"property-type": "data-constant",
|
|
5292
|
-
"default":
|
|
5519
|
+
"default": 0.57,
|
|
5293
5520
|
minimum: 0,
|
|
5294
5521
|
maximum: 1,
|
|
5295
5522
|
experimental: true,
|
|
@@ -5305,19 +5532,52 @@ var rain = {
|
|
|
5305
5532
|
doc: "Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning.",
|
|
5306
5533
|
"sdk-support": {
|
|
5307
5534
|
"basic functionality": {
|
|
5308
|
-
android: "11.
|
|
5309
|
-
ios: "11.
|
|
5535
|
+
android: "11.9.0",
|
|
5536
|
+
ios: "11.9.0"
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
},
|
|
5540
|
+
direction: {
|
|
5541
|
+
type: "array",
|
|
5542
|
+
"default": [
|
|
5543
|
+
0,
|
|
5544
|
+
80
|
|
5545
|
+
],
|
|
5546
|
+
minimum: 0,
|
|
5547
|
+
maximum: 360,
|
|
5548
|
+
length: 2,
|
|
5549
|
+
value: "number",
|
|
5550
|
+
"property-type": "data-constant",
|
|
5551
|
+
transition: true,
|
|
5552
|
+
experimental: true,
|
|
5553
|
+
expression: {
|
|
5554
|
+
interpolated: true,
|
|
5555
|
+
parameters: [
|
|
5556
|
+
"zoom",
|
|
5557
|
+
"measure-light"
|
|
5558
|
+
],
|
|
5559
|
+
relaxZoomRestriction: true
|
|
5560
|
+
},
|
|
5561
|
+
doc: "Main rain particles direction. Azimuth and polar angles.",
|
|
5562
|
+
example: [
|
|
5563
|
+
0,
|
|
5564
|
+
45
|
|
5565
|
+
],
|
|
5566
|
+
"sdk-support": {
|
|
5567
|
+
"basic functionality": {
|
|
5568
|
+
android: "11.9.0",
|
|
5569
|
+
ios: "11.9.0"
|
|
5310
5570
|
}
|
|
5311
5571
|
}
|
|
5312
5572
|
},
|
|
5313
|
-
|
|
5573
|
+
"droplet-size": {
|
|
5314
5574
|
type: "array",
|
|
5315
5575
|
"default": [
|
|
5316
|
-
|
|
5317
|
-
|
|
5576
|
+
2.6,
|
|
5577
|
+
18.2
|
|
5318
5578
|
],
|
|
5319
5579
|
minimum: 0,
|
|
5320
|
-
maximum:
|
|
5580
|
+
maximum: 50,
|
|
5321
5581
|
length: 2,
|
|
5322
5582
|
value: "number",
|
|
5323
5583
|
"property-type": "data-constant",
|
|
@@ -5331,15 +5591,39 @@ var rain = {
|
|
|
5331
5591
|
],
|
|
5332
5592
|
relaxZoomRestriction: true
|
|
5333
5593
|
},
|
|
5334
|
-
doc: "
|
|
5594
|
+
doc: "Rain droplet size. x - normal to direction, y - along direction",
|
|
5335
5595
|
example: [
|
|
5336
5596
|
0,
|
|
5337
5597
|
45
|
|
5338
5598
|
],
|
|
5339
5599
|
"sdk-support": {
|
|
5340
5600
|
"basic functionality": {
|
|
5341
|
-
android: "11.
|
|
5342
|
-
ios: "11.
|
|
5601
|
+
android: "11.9.0",
|
|
5602
|
+
ios: "11.9.0"
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
},
|
|
5606
|
+
"distortion-strength": {
|
|
5607
|
+
type: "number",
|
|
5608
|
+
"property-type": "data-constant",
|
|
5609
|
+
"default": 0.7,
|
|
5610
|
+
minimum: 0,
|
|
5611
|
+
maximum: 1,
|
|
5612
|
+
experimental: true,
|
|
5613
|
+
expression: {
|
|
5614
|
+
interpolated: true,
|
|
5615
|
+
parameters: [
|
|
5616
|
+
"zoom",
|
|
5617
|
+
"measure-light"
|
|
5618
|
+
],
|
|
5619
|
+
relaxZoomRestriction: true
|
|
5620
|
+
},
|
|
5621
|
+
transition: true,
|
|
5622
|
+
doc: "Rain particles screen-space distortion strength.",
|
|
5623
|
+
"sdk-support": {
|
|
5624
|
+
"basic functionality": {
|
|
5625
|
+
android: "11.9.0",
|
|
5626
|
+
ios: "11.9.0"
|
|
5343
5627
|
}
|
|
5344
5628
|
}
|
|
5345
5629
|
}
|
|
@@ -5385,6 +5669,28 @@ var colorTheme = {
|
|
|
5385
5669
|
}
|
|
5386
5670
|
}
|
|
5387
5671
|
};
|
|
5672
|
+
var indoor = {
|
|
5673
|
+
floorplanFeaturesetId: {
|
|
5674
|
+
type: "string",
|
|
5675
|
+
doc: "An ID of a featureset to be used to query indoor floorplans.",
|
|
5676
|
+
experimental: true,
|
|
5677
|
+
transition: false,
|
|
5678
|
+
"property-type": "data-constant",
|
|
5679
|
+
expression: {
|
|
5680
|
+
interpolated: false
|
|
5681
|
+
}
|
|
5682
|
+
},
|
|
5683
|
+
buildingFeaturesetId: {
|
|
5684
|
+
type: "string",
|
|
5685
|
+
doc: "An ID of a featureset to be used to add interactivity for building selection.",
|
|
5686
|
+
experimental: true,
|
|
5687
|
+
transition: false,
|
|
5688
|
+
"property-type": "data-constant",
|
|
5689
|
+
expression: {
|
|
5690
|
+
interpolated: false
|
|
5691
|
+
}
|
|
5692
|
+
}
|
|
5693
|
+
};
|
|
5388
5694
|
var light = {
|
|
5389
5695
|
anchor: {
|
|
5390
5696
|
type: "enum",
|
|
@@ -6044,7 +6350,8 @@ var paint_line = {
|
|
|
6044
6350
|
"zoom",
|
|
6045
6351
|
"feature",
|
|
6046
6352
|
"feature-state",
|
|
6047
|
-
"measure-light"
|
|
6353
|
+
"measure-light",
|
|
6354
|
+
"line-progress"
|
|
6048
6355
|
]
|
|
6049
6356
|
},
|
|
6050
6357
|
"property-type": "data-driven"
|
|
@@ -7942,9 +8249,9 @@ var paint_raster = {
|
|
|
7942
8249
|
],
|
|
7943
8250
|
"sdk-support": {
|
|
7944
8251
|
"basic functionality": {
|
|
7945
|
-
js: "3.
|
|
7946
|
-
android: "11.
|
|
7947
|
-
ios: "11.
|
|
8252
|
+
js: "3.1.0",
|
|
8253
|
+
android: "11.1.0",
|
|
8254
|
+
ios: "11.1.0"
|
|
7948
8255
|
}
|
|
7949
8256
|
},
|
|
7950
8257
|
expression: {
|
|
@@ -8170,7 +8477,7 @@ var paint_background = {
|
|
|
8170
8477
|
doc: "The background is aligned to the plane of the map."
|
|
8171
8478
|
},
|
|
8172
8479
|
viewport: {
|
|
8173
|
-
doc: "The background is aligned to the plane of the viewport, covering the whole screen."
|
|
8480
|
+
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."
|
|
8174
8481
|
}
|
|
8175
8482
|
},
|
|
8176
8483
|
"default": "map",
|
|
@@ -8187,6 +8494,7 @@ var paint_background = {
|
|
|
8187
8494
|
parameters: [
|
|
8188
8495
|
]
|
|
8189
8496
|
},
|
|
8497
|
+
experimental: true,
|
|
8190
8498
|
"property-type": "data-constant"
|
|
8191
8499
|
},
|
|
8192
8500
|
"background-color": {
|
|
@@ -8538,11 +8846,13 @@ var paint_model = {
|
|
|
8538
8846
|
"default": 1,
|
|
8539
8847
|
minimum: 0,
|
|
8540
8848
|
maximum: 1,
|
|
8541
|
-
doc: "The opacity of the model layer.",
|
|
8849
|
+
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.",
|
|
8542
8850
|
transition: true,
|
|
8543
8851
|
expression: {
|
|
8544
8852
|
interpolated: true,
|
|
8545
8853
|
parameters: [
|
|
8854
|
+
"feature",
|
|
8855
|
+
"feature-state",
|
|
8546
8856
|
"zoom"
|
|
8547
8857
|
]
|
|
8548
8858
|
},
|
|
@@ -8551,9 +8861,14 @@ var paint_model = {
|
|
|
8551
8861
|
js: "3.0.0",
|
|
8552
8862
|
android: "11.0.0",
|
|
8553
8863
|
ios: "11.0.0"
|
|
8864
|
+
},
|
|
8865
|
+
"data-driven styling": {
|
|
8866
|
+
js: "3.9.0",
|
|
8867
|
+
android: "11.9.0",
|
|
8868
|
+
ios: "11.9.0"
|
|
8554
8869
|
}
|
|
8555
8870
|
},
|
|
8556
|
-
"property-type": "data-
|
|
8871
|
+
"property-type": "data-driven"
|
|
8557
8872
|
},
|
|
8558
8873
|
"model-rotation": {
|
|
8559
8874
|
type: "array",
|
|
@@ -8980,6 +9295,11 @@ var v8 = {
|
|
|
8980
9295
|
data: {
|
|
8981
9296
|
type: "$root",
|
|
8982
9297
|
doc: "The inlined style that must correspond to the contents of the specified URL."
|
|
9298
|
+
},
|
|
9299
|
+
"color-theme": {
|
|
9300
|
+
type: "colorTheme",
|
|
9301
|
+
optional: true,
|
|
9302
|
+
doc: "If specified, it overrides the color-theme of the imported style."
|
|
8983
9303
|
}
|
|
8984
9304
|
},
|
|
8985
9305
|
config: config,
|
|
@@ -9256,6 +9576,7 @@ var v8 = {
|
|
|
9256
9576
|
rain: rain,
|
|
9257
9577
|
camera: camera,
|
|
9258
9578
|
colorTheme: colorTheme,
|
|
9579
|
+
indoor: indoor,
|
|
9259
9580
|
light: light,
|
|
9260
9581
|
projection: projection,
|
|
9261
9582
|
terrain: terrain,
|
|
@@ -11651,7 +11972,7 @@ class Color {
|
|
|
11651
11972
|
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
|
|
11652
11973
|
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
|
|
11653
11974
|
*/
|
|
11654
|
-
|
|
11975
|
+
toStringPremultipliedAlpha() {
|
|
11655
11976
|
const [r, g, b, a] = this.a === 0 ? [
|
|
11656
11977
|
0,
|
|
11657
11978
|
0,
|
|
@@ -11665,10 +11986,22 @@ class Color {
|
|
|
11665
11986
|
];
|
|
11666
11987
|
return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
|
|
11667
11988
|
}
|
|
11989
|
+
toString() {
|
|
11990
|
+
const [r, g, b, a] = [
|
|
11991
|
+
this.r,
|
|
11992
|
+
this.g,
|
|
11993
|
+
this.b,
|
|
11994
|
+
this.a
|
|
11995
|
+
];
|
|
11996
|
+
return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
|
|
11997
|
+
}
|
|
11668
11998
|
toRenderColor(lut) {
|
|
11669
11999
|
const {r, g, b, a} = this;
|
|
11670
12000
|
return new RenderColor(lut, r, g, b, a);
|
|
11671
12001
|
}
|
|
12002
|
+
clone() {
|
|
12003
|
+
return new Color(this.r, this.g, this.b, this.a);
|
|
12004
|
+
}
|
|
11672
12005
|
}
|
|
11673
12006
|
class RenderColor {
|
|
11674
12007
|
constructor(lut, r, g, b, a) {
|
|
@@ -11730,6 +12063,53 @@ class RenderColor {
|
|
|
11730
12063
|
];
|
|
11731
12064
|
}
|
|
11732
12065
|
/**
|
|
12066
|
+
* Returns an HSLA array of values representing the color, unpremultiplied by A.
|
|
12067
|
+
*
|
|
12068
|
+
* @returns An array of HSLA color values.
|
|
12069
|
+
*/
|
|
12070
|
+
toHslaArray() {
|
|
12071
|
+
if (this.a === 0) {
|
|
12072
|
+
return [
|
|
12073
|
+
0,
|
|
12074
|
+
0,
|
|
12075
|
+
0,
|
|
12076
|
+
0
|
|
12077
|
+
];
|
|
12078
|
+
}
|
|
12079
|
+
const {r, g, b, a} = this;
|
|
12080
|
+
const red = Math.min(Math.max(r / a, 0), 1);
|
|
12081
|
+
const green = Math.min(Math.max(g / a, 0), 1);
|
|
12082
|
+
const blue = Math.min(Math.max(b / a, 0), 1);
|
|
12083
|
+
const min = Math.min(red, green, blue);
|
|
12084
|
+
const max = Math.max(red, green, blue);
|
|
12085
|
+
const l = (min + max) / 2;
|
|
12086
|
+
if (min === max) {
|
|
12087
|
+
return [
|
|
12088
|
+
0,
|
|
12089
|
+
0,
|
|
12090
|
+
l * 100,
|
|
12091
|
+
a
|
|
12092
|
+
];
|
|
12093
|
+
}
|
|
12094
|
+
const delta = max - min;
|
|
12095
|
+
const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
12096
|
+
let h = 0;
|
|
12097
|
+
if (max === red) {
|
|
12098
|
+
h = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
12099
|
+
} else if (max === green) {
|
|
12100
|
+
h = (blue - red) / delta + 2;
|
|
12101
|
+
} else if (max === blue) {
|
|
12102
|
+
h = (red - green) / delta + 4;
|
|
12103
|
+
}
|
|
12104
|
+
h *= 60;
|
|
12105
|
+
return [
|
|
12106
|
+
Math.min(Math.max(h, 0), 360),
|
|
12107
|
+
Math.min(Math.max(s * 100, 0), 100),
|
|
12108
|
+
Math.min(Math.max(l * 100, 0), 100),
|
|
12109
|
+
a
|
|
12110
|
+
];
|
|
12111
|
+
}
|
|
12112
|
+
/**
|
|
11733
12113
|
* Returns a RGBA array of float values representing the color, unpremultiplied by A.
|
|
11734
12114
|
*
|
|
11735
12115
|
* @returns An array of RGBA color values in the range [0, 1].
|
|
@@ -11846,7 +12226,7 @@ class Formatted {
|
|
|
11846
12226
|
isEmpty() {
|
|
11847
12227
|
if (this.sections.length === 0)
|
|
11848
12228
|
return true;
|
|
11849
|
-
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary
|
|
12229
|
+
return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary);
|
|
11850
12230
|
}
|
|
11851
12231
|
static factory(text) {
|
|
11852
12232
|
if (text instanceof Formatted) {
|
|
@@ -11890,42 +12270,113 @@ class Formatted {
|
|
|
11890
12270
|
}
|
|
11891
12271
|
}
|
|
11892
12272
|
|
|
12273
|
+
class ImageIdWithOptions {
|
|
12274
|
+
constructor(id, options) {
|
|
12275
|
+
this.id = id;
|
|
12276
|
+
this.options = options || { params: {} };
|
|
12277
|
+
if (!this.options.transform) {
|
|
12278
|
+
this.options.transform = new DOMMatrix([
|
|
12279
|
+
1,
|
|
12280
|
+
0,
|
|
12281
|
+
0,
|
|
12282
|
+
1,
|
|
12283
|
+
0,
|
|
12284
|
+
0
|
|
12285
|
+
]);
|
|
12286
|
+
} else {
|
|
12287
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12288
|
+
this.options.transform = new DOMMatrix([
|
|
12289
|
+
a,
|
|
12290
|
+
b,
|
|
12291
|
+
c,
|
|
12292
|
+
d,
|
|
12293
|
+
e,
|
|
12294
|
+
f
|
|
12295
|
+
]);
|
|
12296
|
+
}
|
|
12297
|
+
}
|
|
12298
|
+
static deserializeFromString(serialized) {
|
|
12299
|
+
const deserializedObject = JSON.parse(serialized);
|
|
12300
|
+
({ params: deserializedObject.options.params });
|
|
12301
|
+
const {a, b, c, d, e, f} = deserializedObject.options.transform;
|
|
12302
|
+
new DOMMatrix([
|
|
12303
|
+
a,
|
|
12304
|
+
b,
|
|
12305
|
+
c,
|
|
12306
|
+
d,
|
|
12307
|
+
e,
|
|
12308
|
+
f
|
|
12309
|
+
]);
|
|
12310
|
+
return new ImageIdWithOptions(deserializedObject.id, deserializedObject.options);
|
|
12311
|
+
}
|
|
12312
|
+
scaleSelf(factor) {
|
|
12313
|
+
this.options.transform = this.options.transform.scale(factor);
|
|
12314
|
+
return this;
|
|
12315
|
+
}
|
|
12316
|
+
serialize() {
|
|
12317
|
+
const serialisedObject = { id: this.id };
|
|
12318
|
+
if (this.options) {
|
|
12319
|
+
serialisedObject.options = this.options;
|
|
12320
|
+
}
|
|
12321
|
+
const {a, b, c, d, e, f} = this.options.transform;
|
|
12322
|
+
serialisedObject.options.transform = {
|
|
12323
|
+
a,
|
|
12324
|
+
b,
|
|
12325
|
+
c,
|
|
12326
|
+
d,
|
|
12327
|
+
e,
|
|
12328
|
+
f
|
|
12329
|
+
};
|
|
12330
|
+
return JSON.stringify(serialisedObject);
|
|
12331
|
+
}
|
|
12332
|
+
}
|
|
12333
|
+
|
|
11893
12334
|
class ResolvedImage {
|
|
11894
12335
|
constructor(options) {
|
|
11895
12336
|
this.namePrimary = options.namePrimary;
|
|
11896
12337
|
if (options.nameSecondary) {
|
|
11897
12338
|
this.nameSecondary = options.nameSecondary;
|
|
11898
12339
|
}
|
|
12340
|
+
if (options.optionsPrimary) {
|
|
12341
|
+
this.optionsPrimary = options.optionsPrimary;
|
|
12342
|
+
}
|
|
12343
|
+
if (options.optionsSecondary) {
|
|
12344
|
+
this.optionsSecondary = options.optionsSecondary;
|
|
12345
|
+
}
|
|
11899
12346
|
this.available = options.available;
|
|
11900
12347
|
}
|
|
11901
12348
|
toString() {
|
|
11902
|
-
if (this.nameSecondary) {
|
|
12349
|
+
if (this.namePrimary && this.nameSecondary) {
|
|
11903
12350
|
return `[${ this.namePrimary },${ this.nameSecondary }]`;
|
|
11904
12351
|
}
|
|
11905
12352
|
return this.namePrimary;
|
|
11906
12353
|
}
|
|
11907
|
-
|
|
12354
|
+
getPrimary() {
|
|
12355
|
+
return new ImageIdWithOptions(this.namePrimary, { params: this.optionsPrimary ? this.optionsPrimary.params || {} : {} });
|
|
12356
|
+
}
|
|
12357
|
+
getSerializedPrimary() {
|
|
12358
|
+
return this.getPrimary().serialize();
|
|
12359
|
+
}
|
|
12360
|
+
getSecondary() {
|
|
12361
|
+
if (this.nameSecondary) {
|
|
12362
|
+
return new ImageIdWithOptions(this.nameSecondary, { params: this.optionsSecondary ? this.optionsSecondary.params || {} : {} });
|
|
12363
|
+
}
|
|
12364
|
+
return null;
|
|
12365
|
+
}
|
|
12366
|
+
static from(image) {
|
|
12367
|
+
return typeof image === 'string' ? ResolvedImage.build(image) : image;
|
|
12368
|
+
}
|
|
12369
|
+
static build(namePrimary, nameSecondary, optionsPrimary, optionsSecondary) {
|
|
11908
12370
|
if (!namePrimary)
|
|
11909
12371
|
return null;
|
|
11910
12372
|
return new ResolvedImage({
|
|
11911
12373
|
namePrimary,
|
|
11912
12374
|
nameSecondary,
|
|
12375
|
+
optionsPrimary,
|
|
12376
|
+
optionsSecondary,
|
|
11913
12377
|
available: false
|
|
11914
12378
|
});
|
|
11915
12379
|
}
|
|
11916
|
-
serialize() {
|
|
11917
|
-
if (this.nameSecondary) {
|
|
11918
|
-
return [
|
|
11919
|
-
'image',
|
|
11920
|
-
this.namePrimary,
|
|
11921
|
-
this.nameSecondary
|
|
11922
|
-
];
|
|
11923
|
-
}
|
|
11924
|
-
return [
|
|
11925
|
-
'image',
|
|
11926
|
-
this.namePrimary
|
|
11927
|
-
];
|
|
11928
|
-
}
|
|
11929
12380
|
}
|
|
11930
12381
|
|
|
11931
12382
|
function validateRGBA(r, g, b, a) {
|
|
@@ -12066,7 +12517,9 @@ function toString(value) {
|
|
|
12066
12517
|
return '';
|
|
12067
12518
|
} else if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
12068
12519
|
return String(value);
|
|
12069
|
-
} else if (value instanceof Color
|
|
12520
|
+
} else if (value instanceof Color) {
|
|
12521
|
+
return value.toStringPremultipliedAlpha();
|
|
12522
|
+
} else if (value instanceof Formatted || value instanceof ResolvedImage) {
|
|
12070
12523
|
return value.toString();
|
|
12071
12524
|
} else {
|
|
12072
12525
|
return JSON.stringify(value);
|
|
@@ -12315,29 +12768,114 @@ class FormatExpression {
|
|
|
12315
12768
|
}
|
|
12316
12769
|
}
|
|
12317
12770
|
|
|
12771
|
+
function isImageOptions(value) {
|
|
12772
|
+
if (typeof value !== 'string' && !isExpression(value)) {
|
|
12773
|
+
return true;
|
|
12774
|
+
}
|
|
12775
|
+
return false;
|
|
12776
|
+
}
|
|
12318
12777
|
class ImageExpression {
|
|
12319
|
-
constructor(inputPrimary, inputSecondary) {
|
|
12778
|
+
constructor(inputPrimary, inputSecondary, inputPrimaryParams, inputSecondaryParams) {
|
|
12779
|
+
this._imageWarnHistory = {};
|
|
12320
12780
|
this.type = ResolvedImageType;
|
|
12321
12781
|
this.inputPrimary = inputPrimary;
|
|
12322
12782
|
this.inputSecondary = inputSecondary;
|
|
12783
|
+
this.inputPrimaryParams = inputPrimaryParams;
|
|
12784
|
+
this.inputSecondaryParams = inputSecondaryParams;
|
|
12323
12785
|
}
|
|
12324
12786
|
static parse(args, context) {
|
|
12325
12787
|
if (args.length < 2) {
|
|
12326
12788
|
return context.error(`Expected two or more arguments.`);
|
|
12327
12789
|
}
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12790
|
+
let nextArgId = 1;
|
|
12791
|
+
const imageExpression = [];
|
|
12792
|
+
function tryParseImage() {
|
|
12793
|
+
if (nextArgId < args.length) {
|
|
12794
|
+
const imageName = context.parse(args[nextArgId], nextArgId++, StringType);
|
|
12795
|
+
if (!imageName) {
|
|
12796
|
+
context.error(imageExpression.length ? `Secondary image variant is not a string.` : `No image name provided.`);
|
|
12797
|
+
return false;
|
|
12798
|
+
}
|
|
12799
|
+
imageExpression.push({
|
|
12800
|
+
image: imageName,
|
|
12801
|
+
options: void 0
|
|
12802
|
+
});
|
|
12803
|
+
return true;
|
|
12804
|
+
}
|
|
12805
|
+
return true;
|
|
12806
|
+
}
|
|
12807
|
+
function tryParseOptions() {
|
|
12808
|
+
if (nextArgId < args.length) {
|
|
12809
|
+
if (!isImageOptions(args[nextArgId])) {
|
|
12810
|
+
return true;
|
|
12811
|
+
}
|
|
12812
|
+
const params = args[nextArgId].params;
|
|
12813
|
+
const optionsContext = context.concat(nextArgId);
|
|
12814
|
+
if (!params) {
|
|
12815
|
+
nextArgId++;
|
|
12816
|
+
return true;
|
|
12817
|
+
}
|
|
12818
|
+
if (typeof params !== 'object' || params.constructor !== Object) {
|
|
12819
|
+
optionsContext.error(`Image options "params" should be an object`);
|
|
12820
|
+
return false;
|
|
12821
|
+
}
|
|
12822
|
+
const parsed = {};
|
|
12823
|
+
const childContext = optionsContext.concat(void 0, 'params');
|
|
12824
|
+
for (const key in params) {
|
|
12825
|
+
if (!key) {
|
|
12826
|
+
childContext.error(`Image parameter name should be non-empty`);
|
|
12827
|
+
return false;
|
|
12828
|
+
}
|
|
12829
|
+
const value = childContext.concat(void 0, key).parse(params[key], void 0, ColorType, void 0, { typeAnnotation: 'coerce' });
|
|
12830
|
+
if (!value) {
|
|
12831
|
+
return false;
|
|
12832
|
+
}
|
|
12833
|
+
parsed[key] = value;
|
|
12834
|
+
}
|
|
12835
|
+
imageExpression[imageExpression.length - 1].options = parsed;
|
|
12836
|
+
nextArgId++;
|
|
12837
|
+
return true;
|
|
12838
|
+
}
|
|
12839
|
+
return true;
|
|
12840
|
+
}
|
|
12841
|
+
for (let i = 0; i < 2; i++) {
|
|
12842
|
+
if (!tryParseImage() || !tryParseOptions()) {
|
|
12843
|
+
return;
|
|
12844
|
+
}
|
|
12845
|
+
}
|
|
12846
|
+
return new ImageExpression(imageExpression[0].image, imageExpression[1] ? imageExpression[1].image : void 0, imageExpression[0].options, imageExpression[1] ? imageExpression[1].options : void 0);
|
|
12847
|
+
}
|
|
12848
|
+
evaluateParams(ctx, params) {
|
|
12849
|
+
const result = {};
|
|
12850
|
+
if (params) {
|
|
12851
|
+
for (const key in params) {
|
|
12852
|
+
if (params[key]) {
|
|
12853
|
+
try {
|
|
12854
|
+
const color = params[key].evaluate(ctx);
|
|
12855
|
+
const msg = `Ignoring image parameter "${ key }" with semi-transparent color ${ color.toString() }`;
|
|
12856
|
+
if (color.a !== 1) {
|
|
12857
|
+
if (!this._imageWarnHistory[msg]) {
|
|
12858
|
+
console.warn(msg);
|
|
12859
|
+
this._imageWarnHistory[msg] = true;
|
|
12860
|
+
}
|
|
12861
|
+
continue;
|
|
12862
|
+
}
|
|
12863
|
+
result[key] = color;
|
|
12864
|
+
} catch (err) {
|
|
12865
|
+
continue;
|
|
12866
|
+
}
|
|
12867
|
+
}
|
|
12868
|
+
}
|
|
12869
|
+
} else {
|
|
12870
|
+
return void 0;
|
|
12871
|
+
}
|
|
12872
|
+
if (Object.keys(result).length === 0) {
|
|
12873
|
+
return void 0;
|
|
12333
12874
|
}
|
|
12334
|
-
|
|
12335
|
-
if (!nameSecondary)
|
|
12336
|
-
return context.error(`Secondary image variant is not a string.`);
|
|
12337
|
-
return new ImageExpression(namePrimary, nameSecondary);
|
|
12875
|
+
return { params: result };
|
|
12338
12876
|
}
|
|
12339
12877
|
evaluate(ctx) {
|
|
12340
|
-
const value = ResolvedImage.
|
|
12878
|
+
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);
|
|
12341
12879
|
if (value && ctx.availableImages) {
|
|
12342
12880
|
value.available = ctx.availableImages.indexOf(value.namePrimary) > -1;
|
|
12343
12881
|
if (value.nameSecondary && value.available && ctx.availableImages) {
|
|
@@ -12348,25 +12886,55 @@ class ImageExpression {
|
|
|
12348
12886
|
}
|
|
12349
12887
|
eachChild(fn) {
|
|
12350
12888
|
fn(this.inputPrimary);
|
|
12889
|
+
if (this.inputPrimaryParams) {
|
|
12890
|
+
for (const key in this.inputPrimaryParams) {
|
|
12891
|
+
if (this.inputPrimaryParams[key]) {
|
|
12892
|
+
fn(this.inputPrimaryParams[key]);
|
|
12893
|
+
}
|
|
12894
|
+
}
|
|
12895
|
+
}
|
|
12351
12896
|
if (this.inputSecondary) {
|
|
12352
12897
|
fn(this.inputSecondary);
|
|
12898
|
+
if (this.inputSecondaryParams) {
|
|
12899
|
+
for (const key in this.inputSecondaryParams) {
|
|
12900
|
+
if (this.inputSecondaryParams[key]) {
|
|
12901
|
+
fn(this.inputSecondaryParams[key]);
|
|
12902
|
+
}
|
|
12903
|
+
}
|
|
12904
|
+
}
|
|
12353
12905
|
}
|
|
12354
12906
|
}
|
|
12355
12907
|
outputDefined() {
|
|
12356
12908
|
return false;
|
|
12357
12909
|
}
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12910
|
+
serializeParams(params) {
|
|
12911
|
+
const result = {};
|
|
12912
|
+
if (params) {
|
|
12913
|
+
for (const key in params) {
|
|
12914
|
+
if (params[key]) {
|
|
12915
|
+
result[key] = params[key].serialize();
|
|
12916
|
+
}
|
|
12917
|
+
}
|
|
12918
|
+
} else {
|
|
12919
|
+
return void 0;
|
|
12365
12920
|
}
|
|
12366
|
-
return
|
|
12921
|
+
return { params: result };
|
|
12922
|
+
}
|
|
12923
|
+
serialize() {
|
|
12924
|
+
const serialized = [
|
|
12367
12925
|
'image',
|
|
12368
12926
|
this.inputPrimary.serialize()
|
|
12369
12927
|
];
|
|
12928
|
+
if (this.inputPrimaryParams) {
|
|
12929
|
+
serialized.push(this.serializeParams(this.inputPrimaryParams));
|
|
12930
|
+
}
|
|
12931
|
+
if (this.inputSecondary) {
|
|
12932
|
+
serialized.push(this.inputSecondary.serialize());
|
|
12933
|
+
if (this.inputSecondaryParams) {
|
|
12934
|
+
serialized.push(this.serializeParams(this.inputSecondaryParams));
|
|
12935
|
+
}
|
|
12936
|
+
}
|
|
12937
|
+
return serialized;
|
|
12370
12938
|
}
|
|
12371
12939
|
}
|
|
12372
12940
|
|
|
@@ -12494,7 +13062,7 @@ class Coercion {
|
|
|
12494
13062
|
} else if (this.type.kind === 'formatted') {
|
|
12495
13063
|
return Formatted.fromString(toString(this.args[0].evaluate(ctx)));
|
|
12496
13064
|
} else if (this.type.kind === 'resolvedImage') {
|
|
12497
|
-
return ResolvedImage.
|
|
13065
|
+
return ResolvedImage.build(toString(this.args[0].evaluate(ctx)));
|
|
12498
13066
|
} else if (this.type.kind === 'array') {
|
|
12499
13067
|
return this.args.map(arg => {
|
|
12500
13068
|
return arg.evaluate(ctx);
|
|
@@ -14248,7 +14816,7 @@ function coerceValue(type, value) {
|
|
|
14248
14816
|
return Formatted.fromString(toString(value));
|
|
14249
14817
|
}
|
|
14250
14818
|
case 'resolvedImage': {
|
|
14251
|
-
return ResolvedImage.
|
|
14819
|
+
return ResolvedImage.build(toString(value));
|
|
14252
14820
|
}
|
|
14253
14821
|
}
|
|
14254
14822
|
return value;
|
|
@@ -14906,11 +15474,12 @@ var colorSpaces = /*#__PURE__*/Object.freeze({
|
|
|
14906
15474
|
});
|
|
14907
15475
|
|
|
14908
15476
|
class Interpolate {
|
|
14909
|
-
constructor(type, operator, interpolation, input, stops) {
|
|
15477
|
+
constructor(type, operator, interpolation, input, dynamicStops, stops) {
|
|
14910
15478
|
this.type = type;
|
|
14911
15479
|
this.operator = operator;
|
|
14912
15480
|
this.interpolation = interpolation;
|
|
14913
15481
|
this.input = input;
|
|
15482
|
+
this.dynamicStops = dynamicStops;
|
|
14914
15483
|
this.labels = [];
|
|
14915
15484
|
this.outputs = [];
|
|
14916
15485
|
for (const [label, expression] of stops) {
|
|
@@ -14958,10 +15527,10 @@ class Interpolate {
|
|
|
14958
15527
|
} else {
|
|
14959
15528
|
return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0);
|
|
14960
15529
|
}
|
|
14961
|
-
if (args.length - 1 <
|
|
14962
|
-
return context.error(`Expected at least
|
|
15530
|
+
if (args.length - 1 < 3) {
|
|
15531
|
+
return context.error(`Expected at least 3 arguments, but found only ${ args.length - 1 }.`);
|
|
14963
15532
|
}
|
|
14964
|
-
if ((args.length - 1) % 2 !== 0) {
|
|
15533
|
+
if (args.length - 1 > 3 && (args.length - 1) % 2 !== 0) {
|
|
14965
15534
|
return context.error(`Expected an even number of arguments.`);
|
|
14966
15535
|
}
|
|
14967
15536
|
input = context.parse(input, 2, NumberType);
|
|
@@ -14974,6 +15543,12 @@ class Interpolate {
|
|
|
14974
15543
|
} else if (context.expectedType && context.expectedType.kind !== 'value') {
|
|
14975
15544
|
outputType = context.expectedType;
|
|
14976
15545
|
}
|
|
15546
|
+
if (args.length - 1 === 3) {
|
|
15547
|
+
const dynamicStops = context.parse(rest[0], 3, ValueType);
|
|
15548
|
+
if (!dynamicStops)
|
|
15549
|
+
return null;
|
|
15550
|
+
return new Interpolate(outputType, operator, interpolation, input, dynamicStops, stops);
|
|
15551
|
+
}
|
|
14977
15552
|
for (let i = 0; i < rest.length; i += 2) {
|
|
14978
15553
|
const label = rest[i];
|
|
14979
15554
|
const value = rest[i + 1];
|
|
@@ -14997,11 +15572,34 @@ class Interpolate {
|
|
|
14997
15572
|
if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
|
|
14998
15573
|
return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`);
|
|
14999
15574
|
}
|
|
15000
|
-
return new Interpolate(outputType, operator, interpolation, input, stops);
|
|
15575
|
+
return new Interpolate(outputType, operator, interpolation, input, null, stops);
|
|
15001
15576
|
}
|
|
15002
15577
|
evaluate(ctx) {
|
|
15003
|
-
|
|
15004
|
-
|
|
15578
|
+
let labels = this.labels;
|
|
15579
|
+
let outputs = this.outputs;
|
|
15580
|
+
if (this.dynamicStops) {
|
|
15581
|
+
const dynamicStopsValue = this.dynamicStops.evaluate(ctx);
|
|
15582
|
+
if (dynamicStopsValue.length % 2 !== 0) {
|
|
15583
|
+
throw new RuntimeError('Expected an even number of arguments.');
|
|
15584
|
+
}
|
|
15585
|
+
labels = [];
|
|
15586
|
+
outputs = [];
|
|
15587
|
+
for (let i = 0; i < dynamicStopsValue.length; i += 2) {
|
|
15588
|
+
const label = dynamicStopsValue[i];
|
|
15589
|
+
const output = new Literal(NumberType, dynamicStopsValue[i + 1]);
|
|
15590
|
+
if (typeof label !== 'number') {
|
|
15591
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.');
|
|
15592
|
+
}
|
|
15593
|
+
if (labels.length && labels[labels.length - 1] >= label) {
|
|
15594
|
+
throw new RuntimeError('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');
|
|
15595
|
+
}
|
|
15596
|
+
labels.push(label);
|
|
15597
|
+
outputs.push(output);
|
|
15598
|
+
}
|
|
15599
|
+
if (labels.length === 0) {
|
|
15600
|
+
throw new RuntimeError('Expected at least one input/output pair.');
|
|
15601
|
+
}
|
|
15602
|
+
}
|
|
15005
15603
|
if (labels.length === 1) {
|
|
15006
15604
|
return outputs[0].evaluate(ctx);
|
|
15007
15605
|
}
|
|
@@ -15057,8 +15655,12 @@ class Interpolate {
|
|
|
15057
15655
|
interpolation,
|
|
15058
15656
|
this.input.serialize()
|
|
15059
15657
|
];
|
|
15060
|
-
|
|
15061
|
-
serialized.push(this.
|
|
15658
|
+
if (this.dynamicStops) {
|
|
15659
|
+
serialized.push(this.dynamicStops.serialize());
|
|
15660
|
+
} else {
|
|
15661
|
+
for (let i = 0; i < this.labels.length; i++) {
|
|
15662
|
+
serialized.push(this.labels[i], this.outputs[i].serialize());
|
|
15663
|
+
}
|
|
15062
15664
|
}
|
|
15063
15665
|
return serialized;
|
|
15064
15666
|
}
|
|
@@ -16046,6 +16648,13 @@ CompoundExpression.register(expressions, {
|
|
|
16046
16648
|
return v.evaluate(ctx).toRenderColor(null).toArray();
|
|
16047
16649
|
}
|
|
16048
16650
|
],
|
|
16651
|
+
'to-hsla': [
|
|
16652
|
+
array$1(NumberType, 4),
|
|
16653
|
+
[ColorType],
|
|
16654
|
+
(ctx, [v]) => {
|
|
16655
|
+
return v.evaluate(ctx).toRenderColor(null).toHslaArray();
|
|
16656
|
+
}
|
|
16657
|
+
],
|
|
16049
16658
|
'rgb': [
|
|
16050
16659
|
ColorType,
|
|
16051
16660
|
[
|
|
@@ -16810,7 +17419,7 @@ function evaluateIdentityFunction(parameters, propertySpec, input) {
|
|
|
16810
17419
|
} else if (propertySpec.type === 'formatted') {
|
|
16811
17420
|
input = Formatted.fromString(input.toString());
|
|
16812
17421
|
} else if (propertySpec.type === 'resolvedImage') {
|
|
16813
|
-
input = ResolvedImage.
|
|
17422
|
+
input = ResolvedImage.build(input.toString());
|
|
16814
17423
|
} else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
|
|
16815
17424
|
input = void 0;
|
|
16816
17425
|
}
|
|
@@ -16889,10 +17498,11 @@ function createExpression(expression, propertySpec, scope, options) {
|
|
|
16889
17498
|
return success(new StyleExpression(parsed, propertySpec, scope, options));
|
|
16890
17499
|
}
|
|
16891
17500
|
class ZoomConstantExpression {
|
|
16892
|
-
constructor(kind, expression, isLightConstant) {
|
|
17501
|
+
constructor(kind, expression, isLightConstant, isLineProgressConstant) {
|
|
16893
17502
|
this.kind = kind;
|
|
16894
17503
|
this._styleExpression = expression;
|
|
16895
17504
|
this.isLightConstant = isLightConstant;
|
|
17505
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16896
17506
|
this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
|
|
16897
17507
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16898
17508
|
}
|
|
@@ -16904,12 +17514,13 @@ class ZoomConstantExpression {
|
|
|
16904
17514
|
}
|
|
16905
17515
|
}
|
|
16906
17516
|
class ZoomDependentExpression {
|
|
16907
|
-
constructor(kind, expression, zoomStops, interpolationType, isLightConstant) {
|
|
17517
|
+
constructor(kind, expression, zoomStops, interpolationType, isLightConstant, isLineProgressConstant) {
|
|
16908
17518
|
this.kind = kind;
|
|
16909
17519
|
this.zoomStops = zoomStops;
|
|
16910
17520
|
this._styleExpression = expression;
|
|
16911
17521
|
this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
|
|
16912
17522
|
this.isLightConstant = isLightConstant;
|
|
17523
|
+
this.isLineProgressConstant = isLineProgressConstant;
|
|
16913
17524
|
this.configDependencies = getConfigDependencies(expression.expression);
|
|
16914
17525
|
this.interpolationType = interpolationType;
|
|
16915
17526
|
}
|
|
@@ -16964,13 +17575,13 @@ function createPropertyExpression(expression, propertySpec, scope, options) {
|
|
|
16964
17575
|
}
|
|
16965
17576
|
if (!zoomCurve) {
|
|
16966
17577
|
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16967
|
-
new ZoomConstantExpression('constant', expression.value, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16968
|
-
new ZoomConstantExpression('source', expression.value, isLightConstant));
|
|
17578
|
+
new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17579
|
+
new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
|
|
16969
17580
|
}
|
|
16970
17581
|
const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
|
|
16971
17582
|
return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16972
|
-
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
16973
|
-
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant));
|
|
17583
|
+
new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
|
|
17584
|
+
new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
|
|
16974
17585
|
}
|
|
16975
17586
|
class StylePropertyFunction {
|
|
16976
17587
|
constructor(parameters, specification) {
|
|
@@ -18092,6 +18703,14 @@ const operations = {
|
|
|
18092
18703
|
*/
|
|
18093
18704
|
setFog: 'setFog',
|
|
18094
18705
|
/*
|
|
18706
|
+
* { command: 'setSnow', args: [snowProperties] }
|
|
18707
|
+
*/
|
|
18708
|
+
setSnow: 'setSnow',
|
|
18709
|
+
/*
|
|
18710
|
+
* { command: 'setRain', args: [rainProperties] }
|
|
18711
|
+
*/
|
|
18712
|
+
setRain: 'setRain',
|
|
18713
|
+
/*
|
|
18095
18714
|
* { command: 'setCamera', args: [cameraProperties] }
|
|
18096
18715
|
*/
|
|
18097
18716
|
setCamera: 'setCamera',
|
|
@@ -18492,6 +19111,18 @@ function diffStyles(before, after) {
|
|
|
18492
19111
|
args: [after.fog]
|
|
18493
19112
|
});
|
|
18494
19113
|
}
|
|
19114
|
+
if (!deepEqual(before.snow, after.snow)) {
|
|
19115
|
+
commands.push({
|
|
19116
|
+
command: operations.setSnow,
|
|
19117
|
+
args: [after.snow]
|
|
19118
|
+
});
|
|
19119
|
+
}
|
|
19120
|
+
if (!deepEqual(before.rain, after.rain)) {
|
|
19121
|
+
commands.push({
|
|
19122
|
+
command: operations.setRain,
|
|
19123
|
+
args: [after.rain]
|
|
19124
|
+
});
|
|
19125
|
+
}
|
|
18495
19126
|
if (!deepEqual(before.projection, after.projection)) {
|
|
18496
19127
|
commands.push({
|
|
18497
19128
|
command: operations.setProjection,
|
|
@@ -19103,6 +19734,16 @@ function validateProperty(options, propertyType) {
|
|
|
19103
19734
|
const layerSpec = styleSpec[`${ propertyType }_${ options.layerType }`];
|
|
19104
19735
|
if (!layerSpec)
|
|
19105
19736
|
return [];
|
|
19737
|
+
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
19738
|
+
if (propertyType === 'paint' && useThemeMatch && layerSpec[useThemeMatch[1]]) {
|
|
19739
|
+
return validate({
|
|
19740
|
+
key,
|
|
19741
|
+
value,
|
|
19742
|
+
valueSpec: { type: 'string' },
|
|
19743
|
+
style,
|
|
19744
|
+
styleSpec
|
|
19745
|
+
});
|
|
19746
|
+
}
|
|
19106
19747
|
const transitionMatch = propertyKey.match(/^(.*)-transition$/);
|
|
19107
19748
|
if (propertyType === 'paint' && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) {
|
|
19108
19749
|
return validate({
|
|
@@ -19477,7 +20118,16 @@ function validateLight(options) {
|
|
|
19477
20118
|
}
|
|
19478
20119
|
for (const key in light) {
|
|
19479
20120
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19480
|
-
|
|
20121
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20122
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20123
|
+
errors = errors.concat(validate({
|
|
20124
|
+
key,
|
|
20125
|
+
value: light[key],
|
|
20126
|
+
valueSpec: { type: 'string' },
|
|
20127
|
+
style,
|
|
20128
|
+
styleSpec
|
|
20129
|
+
}));
|
|
20130
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19481
20131
|
errors = errors.concat(validate({
|
|
19482
20132
|
key,
|
|
19483
20133
|
value: light[key],
|
|
@@ -19563,7 +20213,16 @@ function validateLights(options) {
|
|
|
19563
20213
|
}
|
|
19564
20214
|
} else {
|
|
19565
20215
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19566
|
-
|
|
20216
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20217
|
+
if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
|
|
20218
|
+
errors = errors.concat(validate({
|
|
20219
|
+
key: key2,
|
|
20220
|
+
value: light[key2],
|
|
20221
|
+
valueSpec: { type: 'string' },
|
|
20222
|
+
style,
|
|
20223
|
+
styleSpec
|
|
20224
|
+
}));
|
|
20225
|
+
} else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
|
|
19567
20226
|
errors = errors.concat(validate({
|
|
19568
20227
|
key: key2,
|
|
19569
20228
|
value: light[key2],
|
|
@@ -19605,7 +20264,16 @@ function validateTerrain(options) {
|
|
|
19605
20264
|
}
|
|
19606
20265
|
for (const key2 in terrain) {
|
|
19607
20266
|
const transitionMatch = key2.match(/^(.*)-transition$/);
|
|
19608
|
-
|
|
20267
|
+
const useThemeMatch = key2.match(/^(.*)-use-theme$/);
|
|
20268
|
+
if (useThemeMatch && terrainSpec[useThemeMatch[1]]) {
|
|
20269
|
+
errors = errors.concat(validate({
|
|
20270
|
+
key: key2,
|
|
20271
|
+
value: terrain[key2],
|
|
20272
|
+
valueSpec: { type: 'string' },
|
|
20273
|
+
style,
|
|
20274
|
+
styleSpec
|
|
20275
|
+
}));
|
|
20276
|
+
} else if (transitionMatch && terrainSpec[transitionMatch[1]] && terrainSpec[transitionMatch[1]].transition) {
|
|
19609
20277
|
errors = errors.concat(validate({
|
|
19610
20278
|
key: key2,
|
|
19611
20279
|
value: terrain[key2],
|
|
@@ -19654,7 +20322,16 @@ function validateFog(options) {
|
|
|
19654
20322
|
}
|
|
19655
20323
|
for (const key in fog) {
|
|
19656
20324
|
const transitionMatch = key.match(/^(.*)-transition$/);
|
|
19657
|
-
|
|
20325
|
+
const useThemeMatch = key.match(/^(.*)-use-theme$/);
|
|
20326
|
+
if (useThemeMatch && fogSpec[useThemeMatch[1]]) {
|
|
20327
|
+
errors = errors.concat(validate({
|
|
20328
|
+
key,
|
|
20329
|
+
value: fog[key],
|
|
20330
|
+
valueSpec: { type: 'string' },
|
|
20331
|
+
style,
|
|
20332
|
+
styleSpec
|
|
20333
|
+
}));
|
|
20334
|
+
} else if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
|
|
19658
20335
|
errors = errors.concat(validate({
|
|
19659
20336
|
key,
|
|
19660
20337
|
value: fog[key],
|