@mapbox/mapbox-gl-style-spec 14.6.0-beta.1 → 14.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +280 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +65 -29
- package/dist/index.es.js +280 -327
- package/dist/index.es.js.map +1 -1
- package/expression/compound_expression.ts +1 -2
- package/expression/definitions/assertion.ts +1 -2
- package/expression/definitions/at.ts +0 -1
- package/expression/definitions/case.ts +0 -1
- package/expression/definitions/coalesce.ts +1 -2
- package/expression/definitions/coercion.ts +1 -2
- package/expression/definitions/collator.ts +7 -5
- package/expression/definitions/distance.ts +1 -1
- package/expression/definitions/format.ts +4 -4
- package/expression/definitions/index.ts +0 -1
- package/expression/definitions/interpolate.ts +1 -2
- package/expression/definitions/length.ts +1 -2
- package/expression/definitions/match.ts +0 -1
- package/expression/definitions/number_format.ts +5 -5
- package/expression/definitions/step.ts +0 -1
- package/expression/definitions/within.ts +3 -3
- package/expression/expression.ts +4 -4
- package/expression/index.ts +3 -6
- package/expression/is_constant.ts +1 -0
- package/expression/parsing_context.ts +28 -5
- package/expression/values.ts +1 -2
- package/feature_filter/index.ts +6 -5
- package/group_by_layout.ts +2 -2
- package/package.json +1 -1
- package/reference/v8.json +231 -20
- package/rollup.config.js +1 -2
- package/style-spec.ts +2 -3
- package/types.ts +72 -40
- package/union-to-intersection.ts +4 -0
- package/util/color.ts +1 -0
- package/util/color_spaces.ts +0 -1
- package/util/deep_equal.ts +1 -1
- package/util/geometry_util.ts +1 -2
- package/validate/validate.ts +2 -3
- package/validate/validate_expression.ts +0 -1
- package/validate/validate_function.ts +1 -1
- package/validate/validate_property.ts +2 -3
- package/validate/validate_style.ts +1 -2
- package/validate_style.min.ts +0 -1
- package/visit.ts +2 -2
package/reference/v8.json
CHANGED
|
@@ -200,6 +200,65 @@
|
|
|
200
200
|
"spruce1-lod1": "asset://spruce1-lod1.glb",
|
|
201
201
|
"spruce1-lod2": "asset://spruce1-lod2.glb"
|
|
202
202
|
}
|
|
203
|
+
},
|
|
204
|
+
"featuresets": {
|
|
205
|
+
"experimental": true,
|
|
206
|
+
"type": "featuresets",
|
|
207
|
+
"doc": "Defines sets of features for querying, interaction, and feature state manipulation.",
|
|
208
|
+
"example": {
|
|
209
|
+
"poi": {
|
|
210
|
+
"selectors": [
|
|
211
|
+
{
|
|
212
|
+
"layer": "poi",
|
|
213
|
+
"properties": {
|
|
214
|
+
"type": ["get", "type"],
|
|
215
|
+
"name": ["get", "name"],
|
|
216
|
+
"brand": "ABC"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"featuresets": {
|
|
225
|
+
"experimental": true,
|
|
226
|
+
"*": {
|
|
227
|
+
"type": "featureset",
|
|
228
|
+
"doc": "Defines a combined set of features from one or more underlying layers within the current style. Features in a style featureset can be queried, interacted with, and their states can be queried and updated."
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"featureset": {
|
|
232
|
+
"experimental": true,
|
|
233
|
+
"selectors": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"value": "selector",
|
|
236
|
+
"doc": "A collection of categorized selectors."
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"selector": {
|
|
240
|
+
"experimental": true,
|
|
241
|
+
"layer": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"doc": "The ID of a layer that exists in the current style.",
|
|
244
|
+
"required": true
|
|
245
|
+
},
|
|
246
|
+
"properties": {
|
|
247
|
+
"type": "selectorProperty",
|
|
248
|
+
"required": false,
|
|
249
|
+
"doc": "Properties accessible to the end user through queried feautures. If properties are empty, no feature properties are exposed. If undefined, all original feature properties will be accessible."
|
|
250
|
+
},
|
|
251
|
+
"featureNamespace": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"required": false,
|
|
254
|
+
"doc": "An optional field that represents the feature namespace defined by the selector within a featureset to which this feature belongs. If the underlying source is the same for multiple selectors within a featureset, the same featureNamespace should be used across those selectors."
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"selectorProperty": {
|
|
258
|
+
"experimental": true,
|
|
259
|
+
"*": {
|
|
260
|
+
"type": "*",
|
|
261
|
+
"doc": "The value of the property. It can be an expression that generates the returned value from the feature, or a constant value specifying the returned value."
|
|
203
262
|
}
|
|
204
263
|
},
|
|
205
264
|
"model": {
|
|
@@ -424,9 +483,6 @@
|
|
|
424
483
|
"default": false,
|
|
425
484
|
"doc": "Enable/Disable shadow casting for this light",
|
|
426
485
|
"transition": false,
|
|
427
|
-
"expression": {
|
|
428
|
-
"interpolated": false
|
|
429
|
-
},
|
|
430
486
|
"property-type": "data-constant",
|
|
431
487
|
"sdk-support": {
|
|
432
488
|
"basic functionality": {
|
|
@@ -512,7 +568,7 @@
|
|
|
512
568
|
"doc": "The position of the light source is aligned to the rotation of the map."
|
|
513
569
|
},
|
|
514
570
|
"viewport": {
|
|
515
|
-
"doc": "The position of the light source is aligned to the rotation of the viewport."
|
|
571
|
+
"doc": "The position of the light source is aligned to the rotation of the viewport. If terrain is enabled, performance regressions may occur in certain scenarios, particularly on lower-end hardware. Ensure that you test your target scenarios on the appropriate hardware to verify performance."
|
|
516
572
|
}
|
|
517
573
|
},
|
|
518
574
|
"property-type": "data-constant",
|
|
@@ -1485,6 +1541,24 @@
|
|
|
1485
1541
|
},
|
|
1486
1542
|
"property-type": "data-constant",
|
|
1487
1543
|
"experimental": true
|
|
1544
|
+
},
|
|
1545
|
+
"clip-layer-scope": {
|
|
1546
|
+
"type": "array",
|
|
1547
|
+
"value": "string",
|
|
1548
|
+
"default": [],
|
|
1549
|
+
"doc": "Removes content from layers with the specified scope. By default all layers are affected. For example specifying `basemap` will only remove content from the Mapbox Standard style layers which have the same scope",
|
|
1550
|
+
"sdk-support": {
|
|
1551
|
+
"basic functionality": {
|
|
1552
|
+
"js": "3.6.0",
|
|
1553
|
+
"android": "11.7.0",
|
|
1554
|
+
"ios": "11.7.0"
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
"expression": {
|
|
1558
|
+
"interpolated": false
|
|
1559
|
+
},
|
|
1560
|
+
"property-type": "data-constant",
|
|
1561
|
+
"experimental": true
|
|
1488
1562
|
}
|
|
1489
1563
|
},
|
|
1490
1564
|
"layout_fill": {
|
|
@@ -1661,7 +1735,6 @@
|
|
|
1661
1735
|
"fill-extrusion-edge-radius": {
|
|
1662
1736
|
"type": "number",
|
|
1663
1737
|
"experimental": true,
|
|
1664
|
-
"private": true,
|
|
1665
1738
|
"default": 0,
|
|
1666
1739
|
"minimum": 0,
|
|
1667
1740
|
"maximum": 1,
|
|
@@ -5392,6 +5465,30 @@
|
|
|
5392
5465
|
]
|
|
5393
5466
|
},
|
|
5394
5467
|
"property-type": "data-constant"
|
|
5468
|
+
},
|
|
5469
|
+
"fill-z-offset": {
|
|
5470
|
+
"type": "number",
|
|
5471
|
+
"doc": "Specifies an uniform elevation in meters. Note: If the value is zero, the layer will be rendered on the ground. Non-zero values will elevate the layer from the sea level, which can cause it to be rendered below the terrain.",
|
|
5472
|
+
"default": 0,
|
|
5473
|
+
"minimum": 0,
|
|
5474
|
+
"transition": true,
|
|
5475
|
+
"experimental": true,
|
|
5476
|
+
"sdk-support": {
|
|
5477
|
+
"basic functionality": {
|
|
5478
|
+
"js": "3.7.0"
|
|
5479
|
+
},
|
|
5480
|
+
"data-driven styling": {
|
|
5481
|
+
"js": "3.7.0"
|
|
5482
|
+
}
|
|
5483
|
+
},
|
|
5484
|
+
"expression": {
|
|
5485
|
+
"interpolated": true,
|
|
5486
|
+
"parameters": [
|
|
5487
|
+
"zoom",
|
|
5488
|
+
"feature"
|
|
5489
|
+
]
|
|
5490
|
+
},
|
|
5491
|
+
"property-type": "data-driven"
|
|
5395
5492
|
}
|
|
5396
5493
|
},
|
|
5397
5494
|
"paint_fill-extrusion": {
|
|
@@ -5615,7 +5712,6 @@
|
|
|
5615
5712
|
"fill-extrusion-ambient-occlusion-intensity": {
|
|
5616
5713
|
"property-type": "data-constant",
|
|
5617
5714
|
"type": "number",
|
|
5618
|
-
"private": true,
|
|
5619
5715
|
"default": 0.0,
|
|
5620
5716
|
"minimum": 0,
|
|
5621
5717
|
"maximum": 1,
|
|
@@ -5638,7 +5734,6 @@
|
|
|
5638
5734
|
"fill-extrusion-ambient-occlusion-radius": {
|
|
5639
5735
|
"property-type": "data-constant",
|
|
5640
5736
|
"type": "number",
|
|
5641
|
-
"private": true,
|
|
5642
5737
|
"default": 3.0,
|
|
5643
5738
|
"minimum": 0,
|
|
5644
5739
|
"expression": {
|
|
@@ -5827,7 +5922,7 @@
|
|
|
5827
5922
|
"experimental": true,
|
|
5828
5923
|
"units": "meters",
|
|
5829
5924
|
"default": 0,
|
|
5830
|
-
"doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters.",
|
|
5925
|
+
"doc": "The extent of the flood light effect on the ground beneath the extruded buildings in meters. Note: this experimental property is evaluated once per tile, during tile initialization. Changing the property value could trigger tile reload. The `feature-state` styling is deprecated and will get removed soon.",
|
|
5831
5926
|
"requires": [
|
|
5832
5927
|
"lights"
|
|
5833
5928
|
],
|
|
@@ -5968,7 +6063,53 @@
|
|
|
5968
6063
|
]
|
|
5969
6064
|
},
|
|
5970
6065
|
"property-type": "data-constant"
|
|
5971
|
-
|
|
6066
|
+
},
|
|
6067
|
+
"fill-extrusion-line-width": {
|
|
6068
|
+
"type": "number",
|
|
6069
|
+
"default": 0,
|
|
6070
|
+
"minimum": 0,
|
|
6071
|
+
"transition": true,
|
|
6072
|
+
"experimental": true,
|
|
6073
|
+
"units": "meters",
|
|
6074
|
+
"doc": "If a non-zero value is provided, it sets the fill-extrusion layer into wall rendering mode. The value is used to render the feature with the given width over the outlines of the geometry. Note: This property is experimental and some other fill-extrusion properties might not be supported with non-zero line width.",
|
|
6075
|
+
"sdk-support": {
|
|
6076
|
+
"basic functionality": {
|
|
6077
|
+
"js": "3.7.0",
|
|
6078
|
+
"android": "11.7.0",
|
|
6079
|
+
"ios": "11.7.0"
|
|
6080
|
+
|
|
6081
|
+
},
|
|
6082
|
+
"data-driven styling": {
|
|
6083
|
+
"js": "3.7.0",
|
|
6084
|
+
"android": "11.7.0",
|
|
6085
|
+
"ios": "11.7.0"
|
|
6086
|
+
}
|
|
6087
|
+
},
|
|
6088
|
+
"expression": {
|
|
6089
|
+
"interpolated": true,
|
|
6090
|
+
"parameters": [
|
|
6091
|
+
"zoom",
|
|
6092
|
+
"feature",
|
|
6093
|
+
"feature-state",
|
|
6094
|
+
"measure-light"
|
|
6095
|
+
]
|
|
6096
|
+
},
|
|
6097
|
+
"property-type": "data-driven"
|
|
6098
|
+
},
|
|
6099
|
+
"fill-extrusion-cast-shadows": {
|
|
6100
|
+
"type": "boolean",
|
|
6101
|
+
"default": true,
|
|
6102
|
+
"doc": "Enable/Disable shadow casting for this layer",
|
|
6103
|
+
"transition": false,
|
|
6104
|
+
"sdk-support": {
|
|
6105
|
+
"basic functionality": {
|
|
6106
|
+
"js": "3.7.0",
|
|
6107
|
+
"android": "11.8.0",
|
|
6108
|
+
"ios": "11.8.0"
|
|
6109
|
+
}
|
|
6110
|
+
},
|
|
6111
|
+
"property-type": "data-constant"
|
|
6112
|
+
}
|
|
5972
6113
|
},
|
|
5973
6114
|
"paint_line": {
|
|
5974
6115
|
"line-opacity": {
|
|
@@ -6493,7 +6634,6 @@
|
|
|
6493
6634
|
"default": 0,
|
|
6494
6635
|
"minimum": 0,
|
|
6495
6636
|
"maximum": 1,
|
|
6496
|
-
"experimental": true,
|
|
6497
6637
|
"doc": "Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.",
|
|
6498
6638
|
"sdk-support": {
|
|
6499
6639
|
"basic functionality": {
|
|
@@ -7034,11 +7174,11 @@
|
|
|
7034
7174
|
"property-type": "data-driven"
|
|
7035
7175
|
},
|
|
7036
7176
|
"icon-occlusion-opacity": {
|
|
7037
|
-
"doc": "The opacity at which the icon will be drawn in case of being depth occluded.
|
|
7177
|
+
"doc": "The opacity at which the icon will be drawn in case of being depth occluded. Absent value means full occlusion against terrain only.",
|
|
7038
7178
|
"type": "number",
|
|
7039
7179
|
"minimum": 0,
|
|
7040
7180
|
"maximum": 1,
|
|
7041
|
-
"default":
|
|
7181
|
+
"default": 0,
|
|
7042
7182
|
"transition": true,
|
|
7043
7183
|
"requires": [
|
|
7044
7184
|
"icon-image"
|
|
@@ -7384,10 +7524,10 @@
|
|
|
7384
7524
|
},
|
|
7385
7525
|
"text-occlusion-opacity": {
|
|
7386
7526
|
"type": "number",
|
|
7387
|
-
"doc": "The opacity at which the text will be drawn in case of being depth occluded.
|
|
7527
|
+
"doc": "The opacity at which the text will be drawn in case of being depth occluded. Absent value means full occlusion against terrain only.",
|
|
7388
7528
|
"minimum": 0,
|
|
7389
7529
|
"maximum": 1,
|
|
7390
|
-
"default":
|
|
7530
|
+
"default": 0,
|
|
7391
7531
|
"transition": true,
|
|
7392
7532
|
"requires": [
|
|
7393
7533
|
"text-field"
|
|
@@ -7679,6 +7819,62 @@
|
|
|
7679
7819
|
"interpolated": false
|
|
7680
7820
|
},
|
|
7681
7821
|
"property-type": "data-constant"
|
|
7822
|
+
},
|
|
7823
|
+
"symbol-z-offset": {
|
|
7824
|
+
"type": "number",
|
|
7825
|
+
"doc": "Specifies an uniform elevation from the ground, in meters.",
|
|
7826
|
+
"default": 0,
|
|
7827
|
+
"minimum": 0,
|
|
7828
|
+
"transition": true,
|
|
7829
|
+
"experimental": true,
|
|
7830
|
+
"sdk-support": {
|
|
7831
|
+
"basic functionality": {
|
|
7832
|
+
"js": "3.7.0",
|
|
7833
|
+
"android": "11.7.0",
|
|
7834
|
+
"ios": "11.7.0"
|
|
7835
|
+
},
|
|
7836
|
+
"data-driven styling": {
|
|
7837
|
+
"js": "3.7.0",
|
|
7838
|
+
"android": "11.7.0",
|
|
7839
|
+
"ios": "11.7.0"
|
|
7840
|
+
}
|
|
7841
|
+
},
|
|
7842
|
+
"expression": {
|
|
7843
|
+
"interpolated": true,
|
|
7844
|
+
"parameters": [
|
|
7845
|
+
"zoom",
|
|
7846
|
+
"feature"
|
|
7847
|
+
]
|
|
7848
|
+
},
|
|
7849
|
+
"property-type": "data-driven"
|
|
7850
|
+
},
|
|
7851
|
+
"symbol-elevation-reference": {
|
|
7852
|
+
"type": "enum",
|
|
7853
|
+
"doc": "Selects the base of symbol-elevation.",
|
|
7854
|
+
"values": {
|
|
7855
|
+
"sea": {
|
|
7856
|
+
"doc": "Elevate symbols relative to the sea level."
|
|
7857
|
+
},
|
|
7858
|
+
"ground": {
|
|
7859
|
+
"doc": "Elevate symbols relative to the ground's height below them."
|
|
7860
|
+
}
|
|
7861
|
+
},
|
|
7862
|
+
"default": "ground",
|
|
7863
|
+
"experimental": true,
|
|
7864
|
+
"sdk-support": {
|
|
7865
|
+
"basic functionality": {
|
|
7866
|
+
"js": "3.7.0",
|
|
7867
|
+
"android": "11.7.0",
|
|
7868
|
+
"ios": "11.7.0"
|
|
7869
|
+
}
|
|
7870
|
+
},
|
|
7871
|
+
"expression": {
|
|
7872
|
+
"interpolated": false,
|
|
7873
|
+
"parameters": [
|
|
7874
|
+
"zoom"
|
|
7875
|
+
]
|
|
7876
|
+
},
|
|
7877
|
+
"property-type": "data-constant"
|
|
7682
7878
|
}
|
|
7683
7879
|
},
|
|
7684
7880
|
"paint_raster": {
|
|
@@ -8142,6 +8338,27 @@
|
|
|
8142
8338
|
}
|
|
8143
8339
|
},
|
|
8144
8340
|
"property-type": "data-constant"
|
|
8341
|
+
},
|
|
8342
|
+
"raster-particle-elevation": {
|
|
8343
|
+
"type": "number",
|
|
8344
|
+
"doc": "Specifies an uniform elevation from the ground, in meters.",
|
|
8345
|
+
"default": 0,
|
|
8346
|
+
"minimum": 0,
|
|
8347
|
+
"transition": true,
|
|
8348
|
+
"sdk-support": {
|
|
8349
|
+
"basic functionality": {
|
|
8350
|
+
"js": "3.7.0",
|
|
8351
|
+
"android": "11.7.0",
|
|
8352
|
+
"ios": "11.7.0"
|
|
8353
|
+
}
|
|
8354
|
+
},
|
|
8355
|
+
"expression": {
|
|
8356
|
+
"interpolated": true,
|
|
8357
|
+
"parameters": [
|
|
8358
|
+
"zoom"
|
|
8359
|
+
]
|
|
8360
|
+
},
|
|
8361
|
+
"property-type": "data-constant"
|
|
8145
8362
|
}
|
|
8146
8363
|
},
|
|
8147
8364
|
"paint_hillshade": {
|
|
@@ -8809,9 +9026,6 @@
|
|
|
8809
9026
|
"default": true,
|
|
8810
9027
|
"doc": "Enable/Disable shadow casting for this layer",
|
|
8811
9028
|
"transition": false,
|
|
8812
|
-
"expression": {
|
|
8813
|
-
"interpolated": false
|
|
8814
|
-
},
|
|
8815
9029
|
"sdk-support": {
|
|
8816
9030
|
"basic functionality": {
|
|
8817
9031
|
"js": "3.0.0",
|
|
@@ -8826,9 +9040,6 @@
|
|
|
8826
9040
|
"default": true,
|
|
8827
9041
|
"doc": "Enable/Disable shadow receiving for this layer",
|
|
8828
9042
|
"transition": false,
|
|
8829
|
-
"expression": {
|
|
8830
|
-
"interpolated": false
|
|
8831
|
-
},
|
|
8832
9043
|
"sdk-support": {
|
|
8833
9044
|
"basic functionality": {
|
|
8834
9045
|
"js": "3.0.0",
|
package/rollup.config.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import replace from '@rollup/plugin-replace';
|
|
3
2
|
import resolve from '@rollup/plugin-node-resolve';
|
|
4
3
|
import commonjs from '@rollup/plugin-commonjs';
|
|
5
4
|
import unassert from 'rollup-plugin-unassert';
|
|
6
5
|
import json from '@rollup/plugin-json';
|
|
7
6
|
import esbuild from 'rollup-plugin-esbuild';
|
|
7
|
+
import {fileURLToPath} from 'url';
|
|
8
8
|
|
|
9
9
|
// Build es modules?
|
|
10
10
|
const esm = 'esm' in process.env;
|
|
11
11
|
|
|
12
|
-
import {fileURLToPath} from 'url';
|
|
13
12
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
14
13
|
|
|
15
14
|
const config = [{
|
package/style-spec.ts
CHANGED
|
@@ -26,8 +26,9 @@ export type StylePropertySpecification = {
|
|
|
26
26
|
'property-type': ExpressionType,
|
|
27
27
|
expression?: ExpressionSpecification,
|
|
28
28
|
transition?: boolean,
|
|
29
|
+
overridable?: boolean,
|
|
29
30
|
default?: boolean,
|
|
30
|
-
tokens
|
|
31
|
+
tokens?: never
|
|
31
32
|
} | {
|
|
32
33
|
type: 'enum',
|
|
33
34
|
'property-type': ExpressionType,
|
|
@@ -82,13 +83,11 @@ import ValidationError from './error/validation_error';
|
|
|
82
83
|
import ParsingError from './error/parsing_error';
|
|
83
84
|
import {StyleExpression, isExpression, createExpression, createPropertyExpression, normalizePropertyExpression, ZoomConstantExpression, ZoomDependentExpression, StylePropertyFunction} from './expression/index';
|
|
84
85
|
import featureFilter, {isExpressionFilter} from './feature_filter/index';
|
|
85
|
-
|
|
86
86
|
import convertFilter from './feature_filter/convert';
|
|
87
87
|
import Color from './util/color';
|
|
88
88
|
import {createFunction, isFunction} from './function/index';
|
|
89
89
|
import convertFunction from './function/convert';
|
|
90
90
|
import {eachSource, eachLayer, eachProperty} from './visit';
|
|
91
|
-
|
|
92
91
|
import validate from './validate_style';
|
|
93
92
|
import validateMapboxApiSupported from './validate_mapbox_api_supported';
|
|
94
93
|
|
package/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated code; do not edit. Edit build/generate-typed-style-spec.ts instead.
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type {UnionToIntersection} from './union-to-intersection';
|
|
3
4
|
|
|
4
5
|
export type ColorSpecification = string;
|
|
5
6
|
|
|
@@ -71,7 +72,8 @@ export type DataDrivenPropertyValueSpecification<T> =
|
|
|
71
72
|
| CameraFunctionSpecification<T>
|
|
72
73
|
| SourceFunctionSpecification<T>
|
|
73
74
|
| CompositeFunctionSpecification<T>
|
|
74
|
-
| ExpressionSpecification
|
|
75
|
+
| ExpressionSpecification
|
|
76
|
+
| (T extends Array<infer U> ? Array<U | ExpressionSpecification> : never);
|
|
75
77
|
|
|
76
78
|
export type StyleSpecification = {
|
|
77
79
|
"version": 8,
|
|
@@ -96,7 +98,11 @@ export type StyleSpecification = {
|
|
|
96
98
|
"transition"?: TransitionSpecification,
|
|
97
99
|
"projection"?: ProjectionSpecification,
|
|
98
100
|
"layers": Array<LayerSpecification>,
|
|
99
|
-
"models"?: ModelsSpecification
|
|
101
|
+
"models"?: ModelsSpecification,
|
|
102
|
+
/**
|
|
103
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
104
|
+
*/
|
|
105
|
+
"featuresets"?: FeaturesetsSpecification
|
|
100
106
|
}
|
|
101
107
|
|
|
102
108
|
export type SourcesSpecification = {
|
|
@@ -181,6 +187,36 @@ export type OptionSpecification = {
|
|
|
181
187
|
"metadata"?: unknown
|
|
182
188
|
}
|
|
183
189
|
|
|
190
|
+
/**
|
|
191
|
+
* @experimental This is experimental and subject to change in future versions.
|
|
192
|
+
*/
|
|
193
|
+
export type FeaturesetsSpecification = {
|
|
194
|
+
[_: string]: FeaturesetSpecification
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @experimental This is experimental and subject to change in future versions.
|
|
199
|
+
*/
|
|
200
|
+
export type FeaturesetSpecification = {
|
|
201
|
+
"selectors"?: Array<SelectorSpecification>
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @experimental This is experimental and subject to change in future versions.
|
|
206
|
+
*/
|
|
207
|
+
export type SelectorSpecification = {
|
|
208
|
+
"layer": string,
|
|
209
|
+
"properties"?: SelectorPropertySpecification,
|
|
210
|
+
"featureNamespace"?: string
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @experimental This is experimental and subject to change in future versions.
|
|
215
|
+
*/
|
|
216
|
+
export type SelectorPropertySpecification = {
|
|
217
|
+
[_: string]: unknown
|
|
218
|
+
}
|
|
219
|
+
|
|
184
220
|
export type VectorSourceSpecification = {
|
|
185
221
|
"type": "vector",
|
|
186
222
|
"url"?: string,
|
|
@@ -311,7 +347,7 @@ export type DirectionalLightSpecification = {
|
|
|
311
347
|
"color-transition"?: TransitionSpecification,
|
|
312
348
|
"intensity"?: PropertyValueSpecification<number>,
|
|
313
349
|
"intensity-transition"?: TransitionSpecification,
|
|
314
|
-
"cast-shadows"?:
|
|
350
|
+
"cast-shadows"?: boolean,
|
|
315
351
|
"shadow-intensity"?: PropertyValueSpecification<number>,
|
|
316
352
|
"shadow-intensity-transition"?: TransitionSpecification
|
|
317
353
|
},
|
|
@@ -364,7 +400,9 @@ export type FillLayerSpecification = {
|
|
|
364
400
|
"fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
365
401
|
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
|
|
366
402
|
"fill-emissive-strength"?: PropertyValueSpecification<number>,
|
|
367
|
-
"fill-emissive-strength-transition"?: TransitionSpecification
|
|
403
|
+
"fill-emissive-strength-transition"?: TransitionSpecification,
|
|
404
|
+
"fill-z-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
405
|
+
"fill-z-offset-transition"?: TransitionSpecification
|
|
368
406
|
}
|
|
369
407
|
}
|
|
370
408
|
|
|
@@ -542,7 +580,13 @@ export type SymbolLayerSpecification = {
|
|
|
542
580
|
"icon-color-saturation"?: ExpressionSpecification,
|
|
543
581
|
"icon-color-contrast"?: ExpressionSpecification,
|
|
544
582
|
"icon-color-brightness-min"?: ExpressionSpecification,
|
|
545
|
-
"icon-color-brightness-max"?: ExpressionSpecification
|
|
583
|
+
"icon-color-brightness-max"?: ExpressionSpecification,
|
|
584
|
+
"symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
585
|
+
"symbol-z-offset-transition"?: TransitionSpecification,
|
|
586
|
+
/**
|
|
587
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
588
|
+
*/
|
|
589
|
+
"symbol-elevation-reference"?: PropertyValueSpecification<"sea" | "ground">
|
|
546
590
|
}
|
|
547
591
|
}
|
|
548
592
|
|
|
@@ -699,7 +743,10 @@ export type FillExtrusionLayerSpecification = {
|
|
|
699
743
|
"fill-extrusion-rounded-roof"?: PropertyValueSpecification<boolean>,
|
|
700
744
|
"fill-extrusion-cutoff-fade-range"?: ExpressionSpecification,
|
|
701
745
|
"fill-extrusion-emissive-strength"?: PropertyValueSpecification<number>,
|
|
702
|
-
"fill-extrusion-emissive-strength-transition"?: TransitionSpecification
|
|
746
|
+
"fill-extrusion-emissive-strength-transition"?: TransitionSpecification,
|
|
747
|
+
"fill-extrusion-line-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
748
|
+
"fill-extrusion-line-width-transition"?: TransitionSpecification,
|
|
749
|
+
"fill-extrusion-cast-shadows"?: boolean
|
|
703
750
|
}
|
|
704
751
|
}
|
|
705
752
|
|
|
@@ -789,7 +836,9 @@ export type RasterParticleLayerSpecification = {
|
|
|
789
836
|
"raster-particle-speed-factor-transition"?: TransitionSpecification,
|
|
790
837
|
"raster-particle-fade-opacity-factor"?: PropertyValueSpecification<number>,
|
|
791
838
|
"raster-particle-fade-opacity-factor-transition"?: TransitionSpecification,
|
|
792
|
-
"raster-particle-reset-rate-factor"?: number
|
|
839
|
+
"raster-particle-reset-rate-factor"?: number,
|
|
840
|
+
"raster-particle-elevation"?: PropertyValueSpecification<number>,
|
|
841
|
+
"raster-particle-elevation-transition"?: TransitionSpecification
|
|
793
842
|
}
|
|
794
843
|
}
|
|
795
844
|
|
|
@@ -870,8 +919,8 @@ export type ModelLayerSpecification = {
|
|
|
870
919
|
"model-color-mix-intensity"?: DataDrivenPropertyValueSpecification<number>,
|
|
871
920
|
"model-color-mix-intensity-transition"?: TransitionSpecification,
|
|
872
921
|
"model-type"?: "common-3d" | "location-indicator",
|
|
873
|
-
"model-cast-shadows"?:
|
|
874
|
-
"model-receive-shadows"?:
|
|
922
|
+
"model-cast-shadows"?: boolean,
|
|
923
|
+
"model-receive-shadows"?: boolean,
|
|
875
924
|
"model-ambient-occlusion-intensity"?: PropertyValueSpecification<number>,
|
|
876
925
|
"model-ambient-occlusion-intensity-transition"?: TransitionSpecification,
|
|
877
926
|
"model-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
|
|
@@ -994,7 +1043,11 @@ export type ClipLayerSpecification = {
|
|
|
994
1043
|
/**
|
|
995
1044
|
* @experimental This property is experimental and subject to change in future versions.
|
|
996
1045
|
*/
|
|
997
|
-
"clip-layer-types"?: ExpressionSpecification
|
|
1046
|
+
"clip-layer-types"?: ExpressionSpecification,
|
|
1047
|
+
/**
|
|
1048
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1049
|
+
*/
|
|
1050
|
+
"clip-layer-scope"?: ExpressionSpecification
|
|
998
1051
|
},
|
|
999
1052
|
"paint"?: never
|
|
1000
1053
|
}
|
|
@@ -1020,6 +1073,10 @@ export type LayerSpecification =
|
|
|
1020
1073
|
| SlotLayerSpecification
|
|
1021
1074
|
| ClipLayerSpecification;
|
|
1022
1075
|
|
|
1076
|
+
export type LayoutSpecification = UnionToIntersection<NonNullable<LayerSpecification['layout']>>;
|
|
1077
|
+
|
|
1078
|
+
export type PaintSpecification = UnionToIntersection<NonNullable<LayerSpecification['paint']>>;
|
|
1079
|
+
|
|
1023
1080
|
// Aliases for easier migration from @types/mapbox-gl
|
|
1024
1081
|
|
|
1025
1082
|
export type Layer = Pick<
|
|
@@ -1118,39 +1175,14 @@ export type SlotLayer = SlotLayerSpecification;
|
|
|
1118
1175
|
export type ClipLayer = ClipLayerSpecification;
|
|
1119
1176
|
|
|
1120
1177
|
/**
|
|
1121
|
-
* @deprecated
|
|
1178
|
+
* @deprecated Use `LayoutSpecification` instead.
|
|
1122
1179
|
*/
|
|
1123
|
-
export type AnyLayout =
|
|
1124
|
-
| FillLayout
|
|
1125
|
-
| LineLayout
|
|
1126
|
-
| SymbolLayout
|
|
1127
|
-
| CircleLayout
|
|
1128
|
-
| HeatmapLayout
|
|
1129
|
-
| FillExtrusionLayout
|
|
1130
|
-
| RasterLayout
|
|
1131
|
-
| RasterParticleLayout
|
|
1132
|
-
| HillshadeLayout
|
|
1133
|
-
| ModelLayout
|
|
1134
|
-
| BackgroundLayout
|
|
1135
|
-
| SkyLayout
|
|
1136
|
-
| ClipLayout;
|
|
1180
|
+
export type AnyLayout = LayoutSpecification;
|
|
1137
1181
|
|
|
1138
1182
|
/**
|
|
1139
|
-
* @deprecated
|
|
1183
|
+
* @deprecated Use `PaintSpecification` instead.
|
|
1140
1184
|
*/
|
|
1141
|
-
export type AnyPaint =
|
|
1142
|
-
| FillPaint
|
|
1143
|
-
| LinePaint
|
|
1144
|
-
| SymbolPaint
|
|
1145
|
-
| CirclePaint
|
|
1146
|
-
| HeatmapPaint
|
|
1147
|
-
| FillExtrusionPaint
|
|
1148
|
-
| RasterPaint
|
|
1149
|
-
| RasterParticlePaint
|
|
1150
|
-
| HillshadePaint
|
|
1151
|
-
| ModelPaint
|
|
1152
|
-
| BackgroundPaint
|
|
1153
|
-
| SkyPaint;
|
|
1185
|
+
export type AnyPaint = PaintSpecification;
|
|
1154
1186
|
|
|
1155
1187
|
/**
|
|
1156
1188
|
* @deprecated Use `ExpressionSpecification` instead.
|
package/util/color.ts
CHANGED
package/util/color_spaces.ts
CHANGED
package/util/deep_equal.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @private
|
|
5
5
|
*/
|
|
6
|
-
function deepEqual(a?: unknown
|
|
6
|
+
function deepEqual(a?: unknown, b?: unknown): boolean {
|
|
7
7
|
if (Array.isArray(a)) {
|
|
8
8
|
if (!Array.isArray(b) || a.length !== b.length) return false;
|
|
9
9
|
for (let i = 0; i < a.length; i++) {
|
package/util/geometry_util.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type Point from '@mapbox/point-geometry';
|
|
2
1
|
import quickselect from 'quickselect';
|
|
3
2
|
|
|
4
|
-
type
|
|
3
|
+
import type Point from '@mapbox/point-geometry';
|
|
5
4
|
|
|
6
5
|
// minX, minY, maxX, maxY
|
|
7
6
|
export type BBox = [number, number, number, number];
|
package/validate/validate.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import extend from '../util/extend';
|
|
2
|
-
import ValidationError from '../error/validation_error';
|
|
3
2
|
import {unbundle, deepUnbundle} from '../util/unbundle_jsonlint';
|
|
4
3
|
import {isExpression} from '../expression/index';
|
|
5
4
|
import {isFunction} from '../function/index';
|
|
6
|
-
|
|
7
5
|
import validateImport from './validate_import';
|
|
8
6
|
import validateFunction from './validate_function';
|
|
9
7
|
import validateExpression from './validate_expression';
|
|
@@ -25,10 +23,11 @@ import validateString from './validate_string';
|
|
|
25
23
|
import validateFormatted from './validate_formatted';
|
|
26
24
|
import validateImage from './validate_image';
|
|
27
25
|
import validateProjection from './validate_projection';
|
|
26
|
+
import getType from '../util/get_type';
|
|
28
27
|
|
|
29
28
|
import type {StyleReference} from '../reference/latest';
|
|
30
29
|
import type {StyleSpecification} from '../types';
|
|
31
|
-
import
|
|
30
|
+
import type ValidationError from '../error/validation_error';
|
|
32
31
|
|
|
33
32
|
const VALIDATORS = {
|
|
34
33
|
'*'() {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ValidationError from '../error/validation_error';
|
|
2
|
-
|
|
3
2
|
import {createExpression, createPropertyExpression} from '../expression/index';
|
|
4
3
|
import {deepUnbundle} from '../util/unbundle_jsonlint';
|
|
5
4
|
import {isStateConstant, isGlobalPropertyConstant, isFeatureConstant} from '../expression/is_constant';
|