@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/dist/index.cjs CHANGED
@@ -113,6 +113,16 @@
113
113
  type: "fog",
114
114
  doc: "A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."
115
115
  },
116
+ snow: {
117
+ type: "snow",
118
+ doc: "Global precipitation particle-based snow. Having snow present in the style forces constant map repaint mode",
119
+ experimental: true
120
+ },
121
+ rain: {
122
+ type: "rain",
123
+ doc: "Global precipitation particle-based rain effect. Having rain present in the style forces constant map repaint mode.",
124
+ experimental: true
125
+ },
116
126
  camera: {
117
127
  type: "camera",
118
128
  doc: "Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."
@@ -121,6 +131,11 @@
121
131
  type: "colorTheme",
122
132
  doc: "A global modifier for the colors of the style."
123
133
  },
134
+ indoor: {
135
+ type: "indoor",
136
+ experimental: true,
137
+ doc: "Controls the behaviour of indoor features."
138
+ },
124
139
  imports: {
125
140
  type: "array",
126
141
  value: "import",
@@ -461,6 +476,28 @@
461
476
  }
462
477
  }
463
478
  },
479
+ "shadow-quality": {
480
+ type: "number",
481
+ "property-type": "data-constant",
482
+ "default": 1,
483
+ minimum: 0,
484
+ maximum: 1,
485
+ expression: {
486
+ interpolated: false,
487
+ parameters: [
488
+ "zoom"
489
+ ]
490
+ },
491
+ transition: false,
492
+ doc: "Determines the quality of the shadows on the map. A value of 1 ensures the highest quality and is the default value.",
493
+ "sdk-support": {
494
+ "basic functionality": {
495
+ android: "11.9.0",
496
+ ios: "11.9.0"
497
+ }
498
+ },
499
+ experimental: true
500
+ },
464
501
  "shadow-intensity": {
465
502
  type: "number",
466
503
  "property-type": "data-constant",
@@ -1509,8 +1546,7 @@
1509
1546
  expression: {
1510
1547
  interpolated: false
1511
1548
  },
1512
- "property-type": "data-constant",
1513
- experimental: true
1549
+ "property-type": "data-constant"
1514
1550
  },
1515
1551
  "clip-layer-scope": {
1516
1552
  type: "array",
@@ -1528,8 +1564,7 @@
1528
1564
  expression: {
1529
1565
  interpolated: false
1530
1566
  },
1531
- "property-type": "data-constant",
1532
- experimental: true
1567
+ "property-type": "data-constant"
1533
1568
  }
1534
1569
  };
1535
1570
  var layout_fill = {
@@ -1962,6 +1997,36 @@
1962
1997
  interpolated: false
1963
1998
  },
1964
1999
  "property-type": "constant"
2000
+ },
2001
+ "line-width-unit": {
2002
+ type: "enum",
2003
+ 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.",
2004
+ values: {
2005
+ pixels: {
2006
+ doc: "Width is rendered in pixels."
2007
+ },
2008
+ meters: {
2009
+ doc: "Width is rendered in meters."
2010
+ }
2011
+ },
2012
+ "default": "pixels",
2013
+ experimental: true,
2014
+ "private": true,
2015
+ transition: false,
2016
+ "sdk-support": {
2017
+ "basic functionality": {
2018
+ js: "3.9.0",
2019
+ android: "11.9.0",
2020
+ ios: "11.9.0"
2021
+ }
2022
+ },
2023
+ expression: {
2024
+ interpolated: false,
2025
+ parameters: [
2026
+ "zoom"
2027
+ ]
2028
+ },
2029
+ "property-type": "data-constant"
1965
2030
  }
1966
2031
  };
1967
2032
  var layout_symbol = {
@@ -2076,7 +2141,7 @@
2076
2141
  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`."
2077
2142
  },
2078
2143
  "viewport-y": {
2079
- doc: "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`."
2144
+ 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`."
2080
2145
  },
2081
2146
  source: {
2082
2147
  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."
@@ -2313,9 +2378,7 @@
2313
2378
  },
2314
2379
  "sdk-support": {
2315
2380
  "basic functionality": {
2316
- js: "3.8.0",
2317
- android: "11.8.0",
2318
- ios: "11.8.0"
2381
+ js: "3.8.0"
2319
2382
  }
2320
2383
  },
2321
2384
  "property-type": "data-constant"
@@ -2827,9 +2890,7 @@
2827
2890
  },
2828
2891
  "sdk-support": {
2829
2892
  "basic functionality": {
2830
- js: "3.8.0",
2831
- android: "11.8.0",
2832
- ios: "11.8.0"
2893
+ js: "3.8.0"
2833
2894
  }
2834
2895
  },
2835
2896
  "property-type": "data-constant"
@@ -4015,7 +4076,7 @@
4015
4076
  }
4016
4077
  },
4017
4078
  image: {
4018
- doc: "Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'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. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",
4079
+ 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.",
4019
4080
  group: "Types",
4020
4081
  "sdk-support": {
4021
4082
  "basic functionality": {
@@ -4080,6 +4141,17 @@
4080
4141
  }
4081
4142
  }
4082
4143
  },
4144
+ "to-hsla": {
4145
+ doc: "Returns a four-element array containing the input color's Hue, Saturation, Luminance and alpha components, in that order.",
4146
+ group: "Color",
4147
+ "sdk-support": {
4148
+ "basic functionality": {
4149
+ js: "3.9.0",
4150
+ android: "11.9.0",
4151
+ ios: "11.9.0"
4152
+ }
4153
+ }
4154
+ },
4083
4155
  "to-color": {
4084
4156
  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.",
4085
4157
  group: "Types",
@@ -5000,7 +5072,19 @@
5000
5072
  density: {
5001
5073
  type: "number",
5002
5074
  "property-type": "data-constant",
5003
- "default": 1,
5075
+ "default": [
5076
+ "interpolate",
5077
+ [
5078
+ "linear"
5079
+ ],
5080
+ [
5081
+ "zoom"
5082
+ ],
5083
+ 11,
5084
+ 0,
5085
+ 13,
5086
+ 0.85
5087
+ ],
5004
5088
  minimum: 0,
5005
5089
  maximum: 1,
5006
5090
  experimental: true,
@@ -5013,11 +5097,11 @@
5013
5097
  relaxZoomRestriction: true
5014
5098
  },
5015
5099
  transition: true,
5016
- doc: "Snow particles density.",
5100
+ doc: "Snow particles density. Controls the overall particles number.",
5017
5101
  "sdk-support": {
5018
5102
  "basic functionality": {
5019
- android: "11.8.0",
5020
- ios: "11.8.0"
5103
+ android: "11.9.0",
5104
+ ios: "11.9.0"
5021
5105
  }
5022
5106
  }
5023
5107
  },
@@ -5037,11 +5121,11 @@
5037
5121
  relaxZoomRestriction: true
5038
5122
  },
5039
5123
  transition: true,
5040
- doc: "Snow particles movement factor.",
5124
+ doc: "Snow particles movement factor. Controls the overall particles movement speed.",
5041
5125
  "sdk-support": {
5042
5126
  "basic functionality": {
5043
- android: "11.8.0",
5044
- ios: "11.8.0"
5127
+ android: "11.9.0",
5128
+ ios: "11.9.0"
5045
5129
  }
5046
5130
  }
5047
5131
  },
@@ -5062,8 +5146,8 @@
5062
5146
  doc: "Snow particles color.",
5063
5147
  "sdk-support": {
5064
5148
  "basic functionality": {
5065
- android: "11.8.0",
5066
- ios: "11.8.0"
5149
+ android: "11.9.0",
5150
+ ios: "11.9.0"
5067
5151
  }
5068
5152
  }
5069
5153
  },
@@ -5086,15 +5170,27 @@
5086
5170
  doc: "Snow particles opacity.",
5087
5171
  "sdk-support": {
5088
5172
  "basic functionality": {
5089
- android: "11.8.0",
5090
- ios: "11.8.0"
5173
+ android: "11.9.0",
5174
+ ios: "11.9.0"
5091
5175
  }
5092
5176
  }
5093
5177
  },
5094
5178
  vignette: {
5095
5179
  type: "number",
5096
5180
  "property-type": "data-constant",
5097
- "default": 0,
5181
+ "default": [
5182
+ "interpolate",
5183
+ [
5184
+ "linear"
5185
+ ],
5186
+ [
5187
+ "zoom"
5188
+ ],
5189
+ 11,
5190
+ 0,
5191
+ 13,
5192
+ 0.3
5193
+ ],
5098
5194
  minimum: 0,
5099
5195
  maximum: 1,
5100
5196
  experimental: true,
@@ -5107,18 +5203,40 @@
5107
5203
  relaxZoomRestriction: true
5108
5204
  },
5109
5205
  transition: true,
5110
- doc: "Snow vignette screen-space effect.",
5206
+ doc: "Snow vignette screen-space effect. Adds snow tint to screen corners",
5111
5207
  "sdk-support": {
5112
5208
  "basic functionality": {
5113
- android: "11.8.0",
5114
- ios: "11.8.0"
5209
+ android: "11.9.0",
5210
+ ios: "11.9.0"
5115
5211
  }
5116
5212
  }
5117
5213
  },
5118
- centerThinning: {
5214
+ "vignette-color": {
5215
+ type: "color",
5216
+ "property-type": "data-constant",
5217
+ "default": "#ffffff",
5218
+ experimental: true,
5219
+ expression: {
5220
+ interpolated: true,
5221
+ parameters: [
5222
+ "zoom",
5223
+ "measure-light"
5224
+ ],
5225
+ relaxZoomRestriction: true
5226
+ },
5227
+ transition: true,
5228
+ doc: "Snow vignette screen-space corners tint color.",
5229
+ "sdk-support": {
5230
+ "basic functionality": {
5231
+ android: "11.9.0",
5232
+ ios: "11.9.0"
5233
+ }
5234
+ }
5235
+ },
5236
+ "center-thinning": {
5119
5237
  type: "number",
5120
5238
  "property-type": "data-constant",
5121
- "default": 1,
5239
+ "default": 0.4,
5122
5240
  minimum: 0,
5123
5241
  maximum: 1,
5124
5242
  experimental: true,
@@ -5134,8 +5252,8 @@
5134
5252
  doc: "Thinning factor of snow particles from center. 0 - no thinning. 1 - maximal central area thinning.",
5135
5253
  "sdk-support": {
5136
5254
  "basic functionality": {
5137
- android: "11.8.0",
5138
- ios: "11.8.0"
5255
+ android: "11.9.0",
5256
+ ios: "11.9.0"
5139
5257
  }
5140
5258
  }
5141
5259
  },
@@ -5143,7 +5261,7 @@
5143
5261
  type: "array",
5144
5262
  "default": [
5145
5263
  0,
5146
- 90
5264
+ 50
5147
5265
  ],
5148
5266
  minimum: 0,
5149
5267
  maximum: 360,
@@ -5160,15 +5278,39 @@
5160
5278
  ],
5161
5279
  relaxZoomRestriction: true
5162
5280
  },
5163
- doc: "Main snow particles direction. Heading & pitch",
5281
+ doc: "Main snow particles direction. Azimuth and polar angles",
5164
5282
  example: [
5165
5283
  0,
5166
5284
  45
5167
5285
  ],
5168
5286
  "sdk-support": {
5169
5287
  "basic functionality": {
5170
- android: "11.8.0",
5171
- ios: "11.8.0"
5288
+ android: "11.9.0",
5289
+ ios: "11.9.0"
5290
+ }
5291
+ }
5292
+ },
5293
+ "flake-size": {
5294
+ type: "number",
5295
+ "property-type": "data-constant",
5296
+ "default": 0.71,
5297
+ minimum: 0,
5298
+ maximum: 5,
5299
+ experimental: true,
5300
+ expression: {
5301
+ interpolated: true,
5302
+ parameters: [
5303
+ "zoom",
5304
+ "measure-light"
5305
+ ],
5306
+ relaxZoomRestriction: true
5307
+ },
5308
+ transition: true,
5309
+ doc: "Snow flake particle size. Correlates with individual particle screen size",
5310
+ "sdk-support": {
5311
+ "basic functionality": {
5312
+ android: "11.9.0",
5313
+ ios: "11.9.0"
5172
5314
  }
5173
5315
  }
5174
5316
  }
@@ -5177,7 +5319,19 @@
5177
5319
  density: {
5178
5320
  type: "number",
5179
5321
  "property-type": "data-constant",
5180
- "default": 1,
5322
+ "default": [
5323
+ "interpolate",
5324
+ [
5325
+ "linear"
5326
+ ],
5327
+ [
5328
+ "zoom"
5329
+ ],
5330
+ 11,
5331
+ 0,
5332
+ 13,
5333
+ 0.5
5334
+ ],
5181
5335
  minimum: 0,
5182
5336
  maximum: 1,
5183
5337
  experimental: true,
@@ -5190,11 +5344,11 @@
5190
5344
  relaxZoomRestriction: true
5191
5345
  },
5192
5346
  transition: true,
5193
- doc: "Rain particles density.",
5347
+ doc: "Rain particles density. Controls the overall screen density of the rain.",
5194
5348
  "sdk-support": {
5195
5349
  "basic functionality": {
5196
- android: "11.8.0",
5197
- ios: "11.8.0"
5350
+ android: "11.9.0",
5351
+ ios: "11.9.0"
5198
5352
  }
5199
5353
  }
5200
5354
  },
@@ -5214,18 +5368,31 @@
5214
5368
  relaxZoomRestriction: true
5215
5369
  },
5216
5370
  transition: true,
5217
- doc: "Rain particles movement factor.",
5371
+ doc: "Rain particles movement factor. Controls the overall rain particles speed",
5218
5372
  "sdk-support": {
5219
5373
  "basic functionality": {
5220
- android: "11.8.0",
5221
- ios: "11.8.0"
5374
+ android: "11.9.0",
5375
+ ios: "11.9.0"
5222
5376
  }
5223
5377
  }
5224
5378
  },
5225
5379
  color: {
5226
5380
  type: "color",
5227
5381
  "property-type": "data-constant",
5228
- "default": "#ffffff",
5382
+ "default": [
5383
+ "interpolate",
5384
+ [
5385
+ "linear"
5386
+ ],
5387
+ [
5388
+ "measure-light",
5389
+ "brightness"
5390
+ ],
5391
+ 0,
5392
+ "#03113d",
5393
+ 0.3,
5394
+ "#a8adbc"
5395
+ ],
5229
5396
  experimental: true,
5230
5397
  expression: {
5231
5398
  interpolated: true,
@@ -5236,18 +5403,31 @@
5236
5403
  relaxZoomRestriction: true
5237
5404
  },
5238
5405
  transition: true,
5239
- doc: "",
5406
+ doc: "Individual rain particle dorplets color.",
5240
5407
  "sdk-support": {
5241
5408
  "basic functionality": {
5242
- android: "11.8.0",
5243
- ios: "11.8.0"
5409
+ android: "11.9.0",
5410
+ ios: "11.9.0"
5244
5411
  }
5245
5412
  }
5246
5413
  },
5247
5414
  opacity: {
5248
5415
  type: "number",
5249
5416
  "property-type": "data-constant",
5250
- "default": 1,
5417
+ "default": [
5418
+ "interpolate",
5419
+ [
5420
+ "linear"
5421
+ ],
5422
+ [
5423
+ "measure-light",
5424
+ "brightness"
5425
+ ],
5426
+ 0,
5427
+ 0.88,
5428
+ 1,
5429
+ 0.7
5430
+ ],
5251
5431
  minimum: 0,
5252
5432
  maximum: 1,
5253
5433
  experimental: true,
@@ -5263,15 +5443,27 @@
5263
5443
  doc: "Rain particles opacity.",
5264
5444
  "sdk-support": {
5265
5445
  "basic functionality": {
5266
- android: "11.8.0",
5267
- ios: "11.8.0"
5446
+ android: "11.9.0",
5447
+ ios: "11.9.0"
5268
5448
  }
5269
5449
  }
5270
5450
  },
5271
5451
  vignette: {
5272
5452
  type: "number",
5273
5453
  "property-type": "data-constant",
5274
- "default": 0,
5454
+ "default": [
5455
+ "interpolate",
5456
+ [
5457
+ "linear"
5458
+ ],
5459
+ [
5460
+ "zoom"
5461
+ ],
5462
+ 11,
5463
+ 0,
5464
+ 13,
5465
+ 1
5466
+ ],
5275
5467
  minimum: 0,
5276
5468
  maximum: 1,
5277
5469
  experimental: true,
@@ -5284,18 +5476,53 @@
5284
5476
  relaxZoomRestriction: true
5285
5477
  },
5286
5478
  transition: true,
5287
- doc: "Rain vignette screen-space effect.",
5479
+ doc: "Screen-space vignette rain tinting effect intensity.",
5288
5480
  "sdk-support": {
5289
5481
  "basic functionality": {
5290
- android: "11.8.0",
5291
- ios: "11.8.0"
5482
+ android: "11.9.0",
5483
+ ios: "11.9.0"
5292
5484
  }
5293
5485
  }
5294
5486
  },
5295
- centerThinning: {
5487
+ "vignette-color": {
5488
+ type: "color",
5489
+ "property-type": "data-constant",
5490
+ "default": [
5491
+ "interpolate",
5492
+ [
5493
+ "linear"
5494
+ ],
5495
+ [
5496
+ "measure-light",
5497
+ "brightness"
5498
+ ],
5499
+ 0,
5500
+ "#001736",
5501
+ 0.3,
5502
+ "#464646"
5503
+ ],
5504
+ experimental: true,
5505
+ expression: {
5506
+ interpolated: true,
5507
+ parameters: [
5508
+ "zoom",
5509
+ "measure-light"
5510
+ ],
5511
+ relaxZoomRestriction: true
5512
+ },
5513
+ transition: true,
5514
+ doc: "Rain vignette screen-space corners tint color.",
5515
+ "sdk-support": {
5516
+ "basic functionality": {
5517
+ android: "11.9.0",
5518
+ ios: "11.9.0"
5519
+ }
5520
+ }
5521
+ },
5522
+ "center-thinning": {
5296
5523
  type: "number",
5297
5524
  "property-type": "data-constant",
5298
- "default": 1,
5525
+ "default": 0.57,
5299
5526
  minimum: 0,
5300
5527
  maximum: 1,
5301
5528
  experimental: true,
@@ -5311,19 +5538,52 @@
5311
5538
  doc: "Thinning factor of rain particles from center. 0 - no thinning. 1 - maximal central area thinning.",
5312
5539
  "sdk-support": {
5313
5540
  "basic functionality": {
5314
- android: "11.8.0",
5315
- ios: "11.8.0"
5541
+ android: "11.9.0",
5542
+ ios: "11.9.0"
5543
+ }
5544
+ }
5545
+ },
5546
+ direction: {
5547
+ type: "array",
5548
+ "default": [
5549
+ 0,
5550
+ 80
5551
+ ],
5552
+ minimum: 0,
5553
+ maximum: 360,
5554
+ length: 2,
5555
+ value: "number",
5556
+ "property-type": "data-constant",
5557
+ transition: true,
5558
+ experimental: true,
5559
+ expression: {
5560
+ interpolated: true,
5561
+ parameters: [
5562
+ "zoom",
5563
+ "measure-light"
5564
+ ],
5565
+ relaxZoomRestriction: true
5566
+ },
5567
+ doc: "Main rain particles direction. Azimuth and polar angles.",
5568
+ example: [
5569
+ 0,
5570
+ 45
5571
+ ],
5572
+ "sdk-support": {
5573
+ "basic functionality": {
5574
+ android: "11.9.0",
5575
+ ios: "11.9.0"
5316
5576
  }
5317
5577
  }
5318
5578
  },
5319
- direction: {
5579
+ "droplet-size": {
5320
5580
  type: "array",
5321
5581
  "default": [
5322
- 0,
5323
- 80
5582
+ 2.6,
5583
+ 18.2
5324
5584
  ],
5325
5585
  minimum: 0,
5326
- maximum: 360,
5586
+ maximum: 50,
5327
5587
  length: 2,
5328
5588
  value: "number",
5329
5589
  "property-type": "data-constant",
@@ -5337,15 +5597,39 @@
5337
5597
  ],
5338
5598
  relaxZoomRestriction: true
5339
5599
  },
5340
- doc: "Main rain particles direction. Heading & pitch",
5600
+ doc: "Rain droplet size. x - normal to direction, y - along direction",
5341
5601
  example: [
5342
5602
  0,
5343
5603
  45
5344
5604
  ],
5345
5605
  "sdk-support": {
5346
5606
  "basic functionality": {
5347
- android: "11.8.0",
5348
- ios: "11.8.0"
5607
+ android: "11.9.0",
5608
+ ios: "11.9.0"
5609
+ }
5610
+ }
5611
+ },
5612
+ "distortion-strength": {
5613
+ type: "number",
5614
+ "property-type": "data-constant",
5615
+ "default": 0.7,
5616
+ minimum: 0,
5617
+ maximum: 1,
5618
+ experimental: true,
5619
+ expression: {
5620
+ interpolated: true,
5621
+ parameters: [
5622
+ "zoom",
5623
+ "measure-light"
5624
+ ],
5625
+ relaxZoomRestriction: true
5626
+ },
5627
+ transition: true,
5628
+ doc: "Rain particles screen-space distortion strength.",
5629
+ "sdk-support": {
5630
+ "basic functionality": {
5631
+ android: "11.9.0",
5632
+ ios: "11.9.0"
5349
5633
  }
5350
5634
  }
5351
5635
  }
@@ -5391,6 +5675,28 @@
5391
5675
  }
5392
5676
  }
5393
5677
  };
5678
+ var indoor = {
5679
+ floorplanFeaturesetId: {
5680
+ type: "string",
5681
+ doc: "An ID of a featureset to be used to query indoor floorplans.",
5682
+ experimental: true,
5683
+ transition: false,
5684
+ "property-type": "data-constant",
5685
+ expression: {
5686
+ interpolated: false
5687
+ }
5688
+ },
5689
+ buildingFeaturesetId: {
5690
+ type: "string",
5691
+ doc: "An ID of a featureset to be used to add interactivity for building selection.",
5692
+ experimental: true,
5693
+ transition: false,
5694
+ "property-type": "data-constant",
5695
+ expression: {
5696
+ interpolated: false
5697
+ }
5698
+ }
5699
+ };
5394
5700
  var light = {
5395
5701
  anchor: {
5396
5702
  type: "enum",
@@ -6050,7 +6356,8 @@
6050
6356
  "zoom",
6051
6357
  "feature",
6052
6358
  "feature-state",
6053
- "measure-light"
6359
+ "measure-light",
6360
+ "line-progress"
6054
6361
  ]
6055
6362
  },
6056
6363
  "property-type": "data-driven"
@@ -7948,9 +8255,9 @@
7948
8255
  ],
7949
8256
  "sdk-support": {
7950
8257
  "basic functionality": {
7951
- js: "3.0.0",
7952
- android: "11.0.0",
7953
- ios: "11.0.0"
8258
+ js: "3.1.0",
8259
+ android: "11.1.0",
8260
+ ios: "11.1.0"
7954
8261
  }
7955
8262
  },
7956
8263
  expression: {
@@ -8176,7 +8483,7 @@
8176
8483
  doc: "The background is aligned to the plane of the map."
8177
8484
  },
8178
8485
  viewport: {
8179
- doc: "The background is aligned to the plane of the viewport, covering the whole screen."
8486
+ 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."
8180
8487
  }
8181
8488
  },
8182
8489
  "default": "map",
@@ -8193,6 +8500,7 @@
8193
8500
  parameters: [
8194
8501
  ]
8195
8502
  },
8503
+ experimental: true,
8196
8504
  "property-type": "data-constant"
8197
8505
  },
8198
8506
  "background-color": {
@@ -8544,11 +8852,13 @@
8544
8852
  "default": 1,
8545
8853
  minimum: 0,
8546
8854
  maximum: 1,
8547
- doc: "The opacity of the model layer.",
8855
+ 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.",
8548
8856
  transition: true,
8549
8857
  expression: {
8550
8858
  interpolated: true,
8551
8859
  parameters: [
8860
+ "feature",
8861
+ "feature-state",
8552
8862
  "zoom"
8553
8863
  ]
8554
8864
  },
@@ -8557,9 +8867,14 @@
8557
8867
  js: "3.0.0",
8558
8868
  android: "11.0.0",
8559
8869
  ios: "11.0.0"
8870
+ },
8871
+ "data-driven styling": {
8872
+ js: "3.9.0",
8873
+ android: "11.9.0",
8874
+ ios: "11.9.0"
8560
8875
  }
8561
8876
  },
8562
- "property-type": "data-constant"
8877
+ "property-type": "data-driven"
8563
8878
  },
8564
8879
  "model-rotation": {
8565
8880
  type: "array",
@@ -8986,6 +9301,11 @@
8986
9301
  data: {
8987
9302
  type: "$root",
8988
9303
  doc: "The inlined style that must correspond to the contents of the specified URL."
9304
+ },
9305
+ "color-theme": {
9306
+ type: "colorTheme",
9307
+ optional: true,
9308
+ doc: "If specified, it overrides the color-theme of the imported style."
8989
9309
  }
8990
9310
  },
8991
9311
  config: config,
@@ -9262,6 +9582,7 @@
9262
9582
  rain: rain,
9263
9583
  camera: camera,
9264
9584
  colorTheme: colorTheme,
9585
+ indoor: indoor,
9265
9586
  light: light,
9266
9587
  projection: projection,
9267
9588
  terrain: terrain,
@@ -11657,7 +11978,7 @@
11657
11978
  * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
11658
11979
  * translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
11659
11980
  */
11660
- toString() {
11981
+ toStringPremultipliedAlpha() {
11661
11982
  const [r, g, b, a] = this.a === 0 ? [
11662
11983
  0,
11663
11984
  0,
@@ -11671,10 +11992,22 @@
11671
11992
  ];
11672
11993
  return `rgba(${ Math.round(r) },${ Math.round(g) },${ Math.round(b) },${ a })`;
11673
11994
  }
11995
+ toString() {
11996
+ const [r, g, b, a] = [
11997
+ this.r,
11998
+ this.g,
11999
+ this.b,
12000
+ this.a
12001
+ ];
12002
+ return `rgba(${ Math.round(r * 255) },${ Math.round(g * 255) },${ Math.round(b * 255) },${ a })`;
12003
+ }
11674
12004
  toRenderColor(lut) {
11675
12005
  const {r, g, b, a} = this;
11676
12006
  return new RenderColor(lut, r, g, b, a);
11677
12007
  }
12008
+ clone() {
12009
+ return new Color(this.r, this.g, this.b, this.a);
12010
+ }
11678
12011
  }
11679
12012
  class RenderColor {
11680
12013
  constructor(lut, r, g, b, a) {
@@ -11736,6 +12069,53 @@
11736
12069
  ];
11737
12070
  }
11738
12071
  /**
12072
+ * Returns an HSLA array of values representing the color, unpremultiplied by A.
12073
+ *
12074
+ * @returns An array of HSLA color values.
12075
+ */
12076
+ toHslaArray() {
12077
+ if (this.a === 0) {
12078
+ return [
12079
+ 0,
12080
+ 0,
12081
+ 0,
12082
+ 0
12083
+ ];
12084
+ }
12085
+ const {r, g, b, a} = this;
12086
+ const red = Math.min(Math.max(r / a, 0), 1);
12087
+ const green = Math.min(Math.max(g / a, 0), 1);
12088
+ const blue = Math.min(Math.max(b / a, 0), 1);
12089
+ const min = Math.min(red, green, blue);
12090
+ const max = Math.max(red, green, blue);
12091
+ const l = (min + max) / 2;
12092
+ if (min === max) {
12093
+ return [
12094
+ 0,
12095
+ 0,
12096
+ l * 100,
12097
+ a
12098
+ ];
12099
+ }
12100
+ const delta = max - min;
12101
+ const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
12102
+ let h = 0;
12103
+ if (max === red) {
12104
+ h = (green - blue) / delta + (green < blue ? 6 : 0);
12105
+ } else if (max === green) {
12106
+ h = (blue - red) / delta + 2;
12107
+ } else if (max === blue) {
12108
+ h = (red - green) / delta + 4;
12109
+ }
12110
+ h *= 60;
12111
+ return [
12112
+ Math.min(Math.max(h, 0), 360),
12113
+ Math.min(Math.max(s * 100, 0), 100),
12114
+ Math.min(Math.max(l * 100, 0), 100),
12115
+ a
12116
+ ];
12117
+ }
12118
+ /**
11739
12119
  * Returns a RGBA array of float values representing the color, unpremultiplied by A.
11740
12120
  *
11741
12121
  * @returns An array of RGBA color values in the range [0, 1].
@@ -11852,7 +12232,7 @@
11852
12232
  isEmpty() {
11853
12233
  if (this.sections.length === 0)
11854
12234
  return true;
11855
- return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary.length !== 0);
12235
+ return !this.sections.some(section => section.text.length !== 0 || section.image && section.image.namePrimary);
11856
12236
  }
11857
12237
  static factory(text) {
11858
12238
  if (text instanceof Formatted) {
@@ -11896,42 +12276,113 @@
11896
12276
  }
11897
12277
  }
11898
12278
 
12279
+ class ImageIdWithOptions {
12280
+ constructor(id, options) {
12281
+ this.id = id;
12282
+ this.options = options || { params: {} };
12283
+ if (!this.options.transform) {
12284
+ this.options.transform = new DOMMatrix([
12285
+ 1,
12286
+ 0,
12287
+ 0,
12288
+ 1,
12289
+ 0,
12290
+ 0
12291
+ ]);
12292
+ } else {
12293
+ const {a, b, c, d, e, f} = this.options.transform;
12294
+ this.options.transform = new DOMMatrix([
12295
+ a,
12296
+ b,
12297
+ c,
12298
+ d,
12299
+ e,
12300
+ f
12301
+ ]);
12302
+ }
12303
+ }
12304
+ static deserializeFromString(serialized) {
12305
+ const deserializedObject = JSON.parse(serialized);
12306
+ ({ params: deserializedObject.options.params });
12307
+ const {a, b, c, d, e, f} = deserializedObject.options.transform;
12308
+ new DOMMatrix([
12309
+ a,
12310
+ b,
12311
+ c,
12312
+ d,
12313
+ e,
12314
+ f
12315
+ ]);
12316
+ return new ImageIdWithOptions(deserializedObject.id, deserializedObject.options);
12317
+ }
12318
+ scaleSelf(factor) {
12319
+ this.options.transform = this.options.transform.scale(factor);
12320
+ return this;
12321
+ }
12322
+ serialize() {
12323
+ const serialisedObject = { id: this.id };
12324
+ if (this.options) {
12325
+ serialisedObject.options = this.options;
12326
+ }
12327
+ const {a, b, c, d, e, f} = this.options.transform;
12328
+ serialisedObject.options.transform = {
12329
+ a,
12330
+ b,
12331
+ c,
12332
+ d,
12333
+ e,
12334
+ f
12335
+ };
12336
+ return JSON.stringify(serialisedObject);
12337
+ }
12338
+ }
12339
+
11899
12340
  class ResolvedImage {
11900
12341
  constructor(options) {
11901
12342
  this.namePrimary = options.namePrimary;
11902
12343
  if (options.nameSecondary) {
11903
12344
  this.nameSecondary = options.nameSecondary;
11904
12345
  }
12346
+ if (options.optionsPrimary) {
12347
+ this.optionsPrimary = options.optionsPrimary;
12348
+ }
12349
+ if (options.optionsSecondary) {
12350
+ this.optionsSecondary = options.optionsSecondary;
12351
+ }
11905
12352
  this.available = options.available;
11906
12353
  }
11907
12354
  toString() {
11908
- if (this.nameSecondary) {
12355
+ if (this.namePrimary && this.nameSecondary) {
11909
12356
  return `[${ this.namePrimary },${ this.nameSecondary }]`;
11910
12357
  }
11911
12358
  return this.namePrimary;
11912
12359
  }
11913
- static fromString(namePrimary, nameSecondary) {
12360
+ getPrimary() {
12361
+ return new ImageIdWithOptions(this.namePrimary, { params: this.optionsPrimary ? this.optionsPrimary.params || {} : {} });
12362
+ }
12363
+ getSerializedPrimary() {
12364
+ return this.getPrimary().serialize();
12365
+ }
12366
+ getSecondary() {
12367
+ if (this.nameSecondary) {
12368
+ return new ImageIdWithOptions(this.nameSecondary, { params: this.optionsSecondary ? this.optionsSecondary.params || {} : {} });
12369
+ }
12370
+ return null;
12371
+ }
12372
+ static from(image) {
12373
+ return typeof image === 'string' ? ResolvedImage.build(image) : image;
12374
+ }
12375
+ static build(namePrimary, nameSecondary, optionsPrimary, optionsSecondary) {
11914
12376
  if (!namePrimary)
11915
12377
  return null;
11916
12378
  return new ResolvedImage({
11917
12379
  namePrimary,
11918
12380
  nameSecondary,
12381
+ optionsPrimary,
12382
+ optionsSecondary,
11919
12383
  available: false
11920
12384
  });
11921
12385
  }
11922
- serialize() {
11923
- if (this.nameSecondary) {
11924
- return [
11925
- 'image',
11926
- this.namePrimary,
11927
- this.nameSecondary
11928
- ];
11929
- }
11930
- return [
11931
- 'image',
11932
- this.namePrimary
11933
- ];
11934
- }
11935
12386
  }
11936
12387
 
11937
12388
  function validateRGBA(r, g, b, a) {
@@ -12072,7 +12523,9 @@
12072
12523
  return '';
12073
12524
  } else if (type === 'string' || type === 'number' || type === 'boolean') {
12074
12525
  return String(value);
12075
- } else if (value instanceof Color || value instanceof Formatted || value instanceof ResolvedImage) {
12526
+ } else if (value instanceof Color) {
12527
+ return value.toStringPremultipliedAlpha();
12528
+ } else if (value instanceof Formatted || value instanceof ResolvedImage) {
12076
12529
  return value.toString();
12077
12530
  } else {
12078
12531
  return JSON.stringify(value);
@@ -12321,29 +12774,114 @@
12321
12774
  }
12322
12775
  }
12323
12776
 
12777
+ function isImageOptions(value) {
12778
+ if (typeof value !== 'string' && !isExpression(value)) {
12779
+ return true;
12780
+ }
12781
+ return false;
12782
+ }
12324
12783
  class ImageExpression {
12325
- constructor(inputPrimary, inputSecondary) {
12784
+ constructor(inputPrimary, inputSecondary, inputPrimaryParams, inputSecondaryParams) {
12785
+ this._imageWarnHistory = {};
12326
12786
  this.type = ResolvedImageType;
12327
12787
  this.inputPrimary = inputPrimary;
12328
12788
  this.inputSecondary = inputSecondary;
12789
+ this.inputPrimaryParams = inputPrimaryParams;
12790
+ this.inputSecondaryParams = inputSecondaryParams;
12329
12791
  }
12330
12792
  static parse(args, context) {
12331
12793
  if (args.length < 2) {
12332
12794
  return context.error(`Expected two or more arguments.`);
12333
12795
  }
12334
- const namePrimary = context.parse(args[1], 1, StringType);
12335
- if (!namePrimary)
12336
- return context.error(`No image name provided.`);
12337
- if (args.length === 2) {
12338
- return new ImageExpression(namePrimary);
12796
+ let nextArgId = 1;
12797
+ const imageExpression = [];
12798
+ function tryParseImage() {
12799
+ if (nextArgId < args.length) {
12800
+ const imageName = context.parse(args[nextArgId], nextArgId++, StringType);
12801
+ if (!imageName) {
12802
+ context.error(imageExpression.length ? `Secondary image variant is not a string.` : `No image name provided.`);
12803
+ return false;
12804
+ }
12805
+ imageExpression.push({
12806
+ image: imageName,
12807
+ options: void 0
12808
+ });
12809
+ return true;
12810
+ }
12811
+ return true;
12812
+ }
12813
+ function tryParseOptions() {
12814
+ if (nextArgId < args.length) {
12815
+ if (!isImageOptions(args[nextArgId])) {
12816
+ return true;
12817
+ }
12818
+ const params = args[nextArgId].params;
12819
+ const optionsContext = context.concat(nextArgId);
12820
+ if (!params) {
12821
+ nextArgId++;
12822
+ return true;
12823
+ }
12824
+ if (typeof params !== 'object' || params.constructor !== Object) {
12825
+ optionsContext.error(`Image options "params" should be an object`);
12826
+ return false;
12827
+ }
12828
+ const parsed = {};
12829
+ const childContext = optionsContext.concat(void 0, 'params');
12830
+ for (const key in params) {
12831
+ if (!key) {
12832
+ childContext.error(`Image parameter name should be non-empty`);
12833
+ return false;
12834
+ }
12835
+ const value = childContext.concat(void 0, key).parse(params[key], void 0, ColorType, void 0, { typeAnnotation: 'coerce' });
12836
+ if (!value) {
12837
+ return false;
12838
+ }
12839
+ parsed[key] = value;
12840
+ }
12841
+ imageExpression[imageExpression.length - 1].options = parsed;
12842
+ nextArgId++;
12843
+ return true;
12844
+ }
12845
+ return true;
12846
+ }
12847
+ for (let i = 0; i < 2; i++) {
12848
+ if (!tryParseImage() || !tryParseOptions()) {
12849
+ return;
12850
+ }
12851
+ }
12852
+ return new ImageExpression(imageExpression[0].image, imageExpression[1] ? imageExpression[1].image : void 0, imageExpression[0].options, imageExpression[1] ? imageExpression[1].options : void 0);
12853
+ }
12854
+ evaluateParams(ctx, params) {
12855
+ const result = {};
12856
+ if (params) {
12857
+ for (const key in params) {
12858
+ if (params[key]) {
12859
+ try {
12860
+ const color = params[key].evaluate(ctx);
12861
+ const msg = `Ignoring image parameter "${ key }" with semi-transparent color ${ color.toString() }`;
12862
+ if (color.a !== 1) {
12863
+ if (!this._imageWarnHistory[msg]) {
12864
+ console.warn(msg);
12865
+ this._imageWarnHistory[msg] = true;
12866
+ }
12867
+ continue;
12868
+ }
12869
+ result[key] = color;
12870
+ } catch (err) {
12871
+ continue;
12872
+ }
12873
+ }
12874
+ }
12875
+ } else {
12876
+ return void 0;
12877
+ }
12878
+ if (Object.keys(result).length === 0) {
12879
+ return void 0;
12339
12880
  }
12340
- const nameSecondary = context.parse(args[2], 1, StringType);
12341
- if (!nameSecondary)
12342
- return context.error(`Secondary image variant is not a string.`);
12343
- return new ImageExpression(namePrimary, nameSecondary);
12881
+ return { params: result };
12344
12882
  }
12345
12883
  evaluate(ctx) {
12346
- const value = ResolvedImage.fromString(this.inputPrimary.evaluate(ctx), this.inputSecondary ? this.inputSecondary.evaluate(ctx) : void 0);
12884
+ 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);
12347
12885
  if (value && ctx.availableImages) {
12348
12886
  value.available = ctx.availableImages.indexOf(value.namePrimary) > -1;
12349
12887
  if (value.nameSecondary && value.available && ctx.availableImages) {
@@ -12354,25 +12892,55 @@
12354
12892
  }
12355
12893
  eachChild(fn) {
12356
12894
  fn(this.inputPrimary);
12895
+ if (this.inputPrimaryParams) {
12896
+ for (const key in this.inputPrimaryParams) {
12897
+ if (this.inputPrimaryParams[key]) {
12898
+ fn(this.inputPrimaryParams[key]);
12899
+ }
12900
+ }
12901
+ }
12357
12902
  if (this.inputSecondary) {
12358
12903
  fn(this.inputSecondary);
12904
+ if (this.inputSecondaryParams) {
12905
+ for (const key in this.inputSecondaryParams) {
12906
+ if (this.inputSecondaryParams[key]) {
12907
+ fn(this.inputSecondaryParams[key]);
12908
+ }
12909
+ }
12910
+ }
12359
12911
  }
12360
12912
  }
12361
12913
  outputDefined() {
12362
12914
  return false;
12363
12915
  }
12364
- serialize() {
12365
- if (this.inputSecondary) {
12366
- return [
12367
- 'image',
12368
- this.inputPrimary.serialize(),
12369
- this.inputSecondary.serialize()
12370
- ];
12916
+ serializeParams(params) {
12917
+ const result = {};
12918
+ if (params) {
12919
+ for (const key in params) {
12920
+ if (params[key]) {
12921
+ result[key] = params[key].serialize();
12922
+ }
12923
+ }
12924
+ } else {
12925
+ return void 0;
12371
12926
  }
12372
- return [
12927
+ return { params: result };
12928
+ }
12929
+ serialize() {
12930
+ const serialized = [
12373
12931
  'image',
12374
12932
  this.inputPrimary.serialize()
12375
12933
  ];
12934
+ if (this.inputPrimaryParams) {
12935
+ serialized.push(this.serializeParams(this.inputPrimaryParams));
12936
+ }
12937
+ if (this.inputSecondary) {
12938
+ serialized.push(this.inputSecondary.serialize());
12939
+ if (this.inputSecondaryParams) {
12940
+ serialized.push(this.serializeParams(this.inputSecondaryParams));
12941
+ }
12942
+ }
12943
+ return serialized;
12376
12944
  }
12377
12945
  }
12378
12946
 
@@ -12500,7 +13068,7 @@
12500
13068
  } else if (this.type.kind === 'formatted') {
12501
13069
  return Formatted.fromString(toString(this.args[0].evaluate(ctx)));
12502
13070
  } else if (this.type.kind === 'resolvedImage') {
12503
- return ResolvedImage.fromString(toString(this.args[0].evaluate(ctx)));
13071
+ return ResolvedImage.build(toString(this.args[0].evaluate(ctx)));
12504
13072
  } else if (this.type.kind === 'array') {
12505
13073
  return this.args.map(arg => {
12506
13074
  return arg.evaluate(ctx);
@@ -14254,7 +14822,7 @@
14254
14822
  return Formatted.fromString(toString(value));
14255
14823
  }
14256
14824
  case 'resolvedImage': {
14257
- return ResolvedImage.fromString(toString(value));
14825
+ return ResolvedImage.build(toString(value));
14258
14826
  }
14259
14827
  }
14260
14828
  return value;
@@ -14912,11 +15480,12 @@
14912
15480
  });
14913
15481
 
14914
15482
  class Interpolate {
14915
- constructor(type, operator, interpolation, input, stops) {
15483
+ constructor(type, operator, interpolation, input, dynamicStops, stops) {
14916
15484
  this.type = type;
14917
15485
  this.operator = operator;
14918
15486
  this.interpolation = interpolation;
14919
15487
  this.input = input;
15488
+ this.dynamicStops = dynamicStops;
14920
15489
  this.labels = [];
14921
15490
  this.outputs = [];
14922
15491
  for (const [label, expression] of stops) {
@@ -14964,10 +15533,10 @@
14964
15533
  } else {
14965
15534
  return context.error(`Unknown interpolation type ${ String(interpolation[0]) }`, 1, 0);
14966
15535
  }
14967
- if (args.length - 1 < 4) {
14968
- return context.error(`Expected at least 4 arguments, but found only ${ args.length - 1 }.`);
15536
+ if (args.length - 1 < 3) {
15537
+ return context.error(`Expected at least 3 arguments, but found only ${ args.length - 1 }.`);
14969
15538
  }
14970
- if ((args.length - 1) % 2 !== 0) {
15539
+ if (args.length - 1 > 3 && (args.length - 1) % 2 !== 0) {
14971
15540
  return context.error(`Expected an even number of arguments.`);
14972
15541
  }
14973
15542
  input = context.parse(input, 2, NumberType);
@@ -14980,6 +15549,12 @@
14980
15549
  } else if (context.expectedType && context.expectedType.kind !== 'value') {
14981
15550
  outputType = context.expectedType;
14982
15551
  }
15552
+ if (args.length - 1 === 3) {
15553
+ const dynamicStops = context.parse(rest[0], 3, ValueType);
15554
+ if (!dynamicStops)
15555
+ return null;
15556
+ return new Interpolate(outputType, operator, interpolation, input, dynamicStops, stops);
15557
+ }
14983
15558
  for (let i = 0; i < rest.length; i += 2) {
14984
15559
  const label = rest[i];
14985
15560
  const value = rest[i + 1];
@@ -15003,11 +15578,34 @@
15003
15578
  if (outputType.kind !== 'number' && outputType.kind !== 'color' && !(outputType.kind === 'array' && outputType.itemType.kind === 'number' && typeof outputType.N === 'number')) {
15004
15579
  return context.error(`Type ${ toString$1(outputType) } is not interpolatable.`);
15005
15580
  }
15006
- return new Interpolate(outputType, operator, interpolation, input, stops);
15581
+ return new Interpolate(outputType, operator, interpolation, input, null, stops);
15007
15582
  }
15008
15583
  evaluate(ctx) {
15009
- const labels = this.labels;
15010
- const outputs = this.outputs;
15584
+ let labels = this.labels;
15585
+ let outputs = this.outputs;
15586
+ if (this.dynamicStops) {
15587
+ const dynamicStopsValue = this.dynamicStops.evaluate(ctx);
15588
+ if (dynamicStopsValue.length % 2 !== 0) {
15589
+ throw new RuntimeError('Expected an even number of arguments.');
15590
+ }
15591
+ labels = [];
15592
+ outputs = [];
15593
+ for (let i = 0; i < dynamicStopsValue.length; i += 2) {
15594
+ const label = dynamicStopsValue[i];
15595
+ const output = new Literal(NumberType, dynamicStopsValue[i + 1]);
15596
+ if (typeof label !== 'number') {
15597
+ throw new RuntimeError('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.');
15598
+ }
15599
+ if (labels.length && labels[labels.length - 1] >= label) {
15600
+ throw new RuntimeError('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');
15601
+ }
15602
+ labels.push(label);
15603
+ outputs.push(output);
15604
+ }
15605
+ if (labels.length === 0) {
15606
+ throw new RuntimeError('Expected at least one input/output pair.');
15607
+ }
15608
+ }
15011
15609
  if (labels.length === 1) {
15012
15610
  return outputs[0].evaluate(ctx);
15013
15611
  }
@@ -15063,8 +15661,12 @@
15063
15661
  interpolation,
15064
15662
  this.input.serialize()
15065
15663
  ];
15066
- for (let i = 0; i < this.labels.length; i++) {
15067
- serialized.push(this.labels[i], this.outputs[i].serialize());
15664
+ if (this.dynamicStops) {
15665
+ serialized.push(this.dynamicStops.serialize());
15666
+ } else {
15667
+ for (let i = 0; i < this.labels.length; i++) {
15668
+ serialized.push(this.labels[i], this.outputs[i].serialize());
15669
+ }
15068
15670
  }
15069
15671
  return serialized;
15070
15672
  }
@@ -16052,6 +16654,13 @@
16052
16654
  return v.evaluate(ctx).toRenderColor(null).toArray();
16053
16655
  }
16054
16656
  ],
16657
+ 'to-hsla': [
16658
+ array$1(NumberType, 4),
16659
+ [ColorType],
16660
+ (ctx, [v]) => {
16661
+ return v.evaluate(ctx).toRenderColor(null).toHslaArray();
16662
+ }
16663
+ ],
16055
16664
  'rgb': [
16056
16665
  ColorType,
16057
16666
  [
@@ -16816,7 +17425,7 @@
16816
17425
  } else if (propertySpec.type === 'formatted') {
16817
17426
  input = Formatted.fromString(input.toString());
16818
17427
  } else if (propertySpec.type === 'resolvedImage') {
16819
- input = ResolvedImage.fromString(input.toString());
17428
+ input = ResolvedImage.build(input.toString());
16820
17429
  } else if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {
16821
17430
  input = void 0;
16822
17431
  }
@@ -16895,10 +17504,11 @@
16895
17504
  return success(new StyleExpression(parsed, propertySpec, scope, options));
16896
17505
  }
16897
17506
  class ZoomConstantExpression {
16898
- constructor(kind, expression, isLightConstant) {
17507
+ constructor(kind, expression, isLightConstant, isLineProgressConstant) {
16899
17508
  this.kind = kind;
16900
17509
  this._styleExpression = expression;
16901
17510
  this.isLightConstant = isLightConstant;
17511
+ this.isLineProgressConstant = isLineProgressConstant;
16902
17512
  this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);
16903
17513
  this.configDependencies = getConfigDependencies(expression.expression);
16904
17514
  }
@@ -16910,12 +17520,13 @@
16910
17520
  }
16911
17521
  }
16912
17522
  class ZoomDependentExpression {
16913
- constructor(kind, expression, zoomStops, interpolationType, isLightConstant) {
17523
+ constructor(kind, expression, zoomStops, interpolationType, isLightConstant, isLineProgressConstant) {
16914
17524
  this.kind = kind;
16915
17525
  this.zoomStops = zoomStops;
16916
17526
  this._styleExpression = expression;
16917
17527
  this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);
16918
17528
  this.isLightConstant = isLightConstant;
17529
+ this.isLineProgressConstant = isLineProgressConstant;
16919
17530
  this.configDependencies = getConfigDependencies(expression.expression);
16920
17531
  this.interpolationType = interpolationType;
16921
17532
  }
@@ -16970,13 +17581,13 @@
16970
17581
  }
16971
17582
  if (!zoomCurve) {
16972
17583
  return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16973
- new ZoomConstantExpression('constant', expression.value, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16974
- new ZoomConstantExpression('source', expression.value, isLightConstant));
17584
+ new ZoomConstantExpression('constant', expression.value, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
17585
+ new ZoomConstantExpression('source', expression.value, isLightConstant, isLineProgressConstant));
16975
17586
  }
16976
17587
  const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
16977
17588
  return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16978
- new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16979
- new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant));
17589
+ new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
17590
+ new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant, isLineProgressConstant));
16980
17591
  }
16981
17592
  class StylePropertyFunction {
16982
17593
  constructor(parameters, specification) {
@@ -18098,6 +18709,14 @@ ${ JSON.stringify(filterExp, null, 2) }
18098
18709
  */
18099
18710
  setFog: 'setFog',
18100
18711
  /*
18712
+ * { command: 'setSnow', args: [snowProperties] }
18713
+ */
18714
+ setSnow: 'setSnow',
18715
+ /*
18716
+ * { command: 'setRain', args: [rainProperties] }
18717
+ */
18718
+ setRain: 'setRain',
18719
+ /*
18101
18720
  * { command: 'setCamera', args: [cameraProperties] }
18102
18721
  */
18103
18722
  setCamera: 'setCamera',
@@ -18498,6 +19117,18 @@ ${ JSON.stringify(filterExp, null, 2) }
18498
19117
  args: [after.fog]
18499
19118
  });
18500
19119
  }
19120
+ if (!deepEqual(before.snow, after.snow)) {
19121
+ commands.push({
19122
+ command: operations.setSnow,
19123
+ args: [after.snow]
19124
+ });
19125
+ }
19126
+ if (!deepEqual(before.rain, after.rain)) {
19127
+ commands.push({
19128
+ command: operations.setRain,
19129
+ args: [after.rain]
19130
+ });
19131
+ }
18501
19132
  if (!deepEqual(before.projection, after.projection)) {
18502
19133
  commands.push({
18503
19134
  command: operations.setProjection,
@@ -19109,6 +19740,16 @@ ${ JSON.stringify(filterExp, null, 2) }
19109
19740
  const layerSpec = styleSpec[`${ propertyType }_${ options.layerType }`];
19110
19741
  if (!layerSpec)
19111
19742
  return [];
19743
+ const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
19744
+ if (propertyType === 'paint' && useThemeMatch && layerSpec[useThemeMatch[1]]) {
19745
+ return validate({
19746
+ key,
19747
+ value,
19748
+ valueSpec: { type: 'string' },
19749
+ style,
19750
+ styleSpec
19751
+ });
19752
+ }
19112
19753
  const transitionMatch = propertyKey.match(/^(.*)-transition$/);
19113
19754
  if (propertyType === 'paint' && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) {
19114
19755
  return validate({
@@ -19483,7 +20124,16 @@ Use an identity property function instead: ${ example }.`)];
19483
20124
  }
19484
20125
  for (const key in light) {
19485
20126
  const transitionMatch = key.match(/^(.*)-transition$/);
19486
- if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
20127
+ const useThemeMatch = key.match(/^(.*)-use-theme$/);
20128
+ if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
20129
+ errors = errors.concat(validate({
20130
+ key,
20131
+ value: light[key],
20132
+ valueSpec: { type: 'string' },
20133
+ style,
20134
+ styleSpec
20135
+ }));
20136
+ } else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
19487
20137
  errors = errors.concat(validate({
19488
20138
  key,
19489
20139
  value: light[key],
@@ -19569,7 +20219,16 @@ Use an identity property function instead: ${ example }.`)];
19569
20219
  }
19570
20220
  } else {
19571
20221
  const transitionMatch = key2.match(/^(.*)-transition$/);
19572
- if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
20222
+ const useThemeMatch = key2.match(/^(.*)-use-theme$/);
20223
+ if (useThemeMatch && lightSpec[useThemeMatch[1]]) {
20224
+ errors = errors.concat(validate({
20225
+ key: key2,
20226
+ value: light[key2],
20227
+ valueSpec: { type: 'string' },
20228
+ style,
20229
+ styleSpec
20230
+ }));
20231
+ } else if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {
19573
20232
  errors = errors.concat(validate({
19574
20233
  key: key2,
19575
20234
  value: light[key2],
@@ -19611,7 +20270,16 @@ Use an identity property function instead: ${ example }.`)];
19611
20270
  }
19612
20271
  for (const key2 in terrain) {
19613
20272
  const transitionMatch = key2.match(/^(.*)-transition$/);
19614
- if (transitionMatch && terrainSpec[transitionMatch[1]] && terrainSpec[transitionMatch[1]].transition) {
20273
+ const useThemeMatch = key2.match(/^(.*)-use-theme$/);
20274
+ if (useThemeMatch && terrainSpec[useThemeMatch[1]]) {
20275
+ errors = errors.concat(validate({
20276
+ key: key2,
20277
+ value: terrain[key2],
20278
+ valueSpec: { type: 'string' },
20279
+ style,
20280
+ styleSpec
20281
+ }));
20282
+ } else if (transitionMatch && terrainSpec[transitionMatch[1]] && terrainSpec[transitionMatch[1]].transition) {
19615
20283
  errors = errors.concat(validate({
19616
20284
  key: key2,
19617
20285
  value: terrain[key2],
@@ -19660,7 +20328,16 @@ Use an identity property function instead: ${ example }.`)];
19660
20328
  }
19661
20329
  for (const key in fog) {
19662
20330
  const transitionMatch = key.match(/^(.*)-transition$/);
19663
- if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
20331
+ const useThemeMatch = key.match(/^(.*)-use-theme$/);
20332
+ if (useThemeMatch && fogSpec[useThemeMatch[1]]) {
20333
+ errors = errors.concat(validate({
20334
+ key,
20335
+ value: fog[key],
20336
+ valueSpec: { type: 'string' },
20337
+ style,
20338
+ styleSpec
20339
+ }));
20340
+ } else if (transitionMatch && fogSpec[transitionMatch[1]] && fogSpec[transitionMatch[1]].transition) {
19664
20341
  errors = errors.concat(validate({
19665
20342
  key,
19666
20343
  value: fog[key],