@mapbox/mapbox-gl-style-spec 14.6.0 → 14.7.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 +2423 -2497
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +57 -29
- package/dist/index.es.js +2423 -2497
- 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 +4 -7
- 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 +196 -37
- package/rollup.config.js +1 -2
- package/style-spec.ts +2 -3
- package/types.ts +59 -36
- 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",
|
|
@@ -1679,7 +1735,6 @@
|
|
|
1679
1735
|
"fill-extrusion-edge-radius": {
|
|
1680
1736
|
"type": "number",
|
|
1681
1737
|
"experimental": true,
|
|
1682
|
-
"private": true,
|
|
1683
1738
|
"default": 0,
|
|
1684
1739
|
"minimum": 0,
|
|
1685
1740
|
"maximum": 1,
|
|
@@ -5410,6 +5465,30 @@
|
|
|
5410
5465
|
]
|
|
5411
5466
|
},
|
|
5412
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"
|
|
5413
5492
|
}
|
|
5414
5493
|
},
|
|
5415
5494
|
"paint_fill-extrusion": {
|
|
@@ -5633,7 +5712,6 @@
|
|
|
5633
5712
|
"fill-extrusion-ambient-occlusion-intensity": {
|
|
5634
5713
|
"property-type": "data-constant",
|
|
5635
5714
|
"type": "number",
|
|
5636
|
-
"private": true,
|
|
5637
5715
|
"default": 0.0,
|
|
5638
5716
|
"minimum": 0,
|
|
5639
5717
|
"maximum": 1,
|
|
@@ -5656,7 +5734,6 @@
|
|
|
5656
5734
|
"fill-extrusion-ambient-occlusion-radius": {
|
|
5657
5735
|
"property-type": "data-constant",
|
|
5658
5736
|
"type": "number",
|
|
5659
|
-
"private": true,
|
|
5660
5737
|
"default": 3.0,
|
|
5661
5738
|
"minimum": 0,
|
|
5662
5739
|
"expression": {
|
|
@@ -5845,7 +5922,7 @@
|
|
|
5845
5922
|
"experimental": true,
|
|
5846
5923
|
"units": "meters",
|
|
5847
5924
|
"default": 0,
|
|
5848
|
-
"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.",
|
|
5849
5926
|
"requires": [
|
|
5850
5927
|
"lights"
|
|
5851
5928
|
],
|
|
@@ -5976,30 +6053,42 @@
|
|
|
5976
6053
|
"js": "3.0.0",
|
|
5977
6054
|
"android": "11.0.0",
|
|
5978
6055
|
"ios": "11.0.0"
|
|
6056
|
+
},
|
|
6057
|
+
"data-driven styling": {
|
|
6058
|
+
"js": "3.8.0",
|
|
6059
|
+
"android": "11.8.0",
|
|
6060
|
+
"ios": "11.8.0"
|
|
5979
6061
|
}
|
|
5980
6062
|
},
|
|
5981
6063
|
"expression": {
|
|
5982
6064
|
"interpolated": true,
|
|
5983
6065
|
"parameters": [
|
|
5984
6066
|
"zoom",
|
|
5985
|
-
"measure-light"
|
|
6067
|
+
"measure-light",
|
|
6068
|
+
"feature-state"
|
|
5986
6069
|
]
|
|
5987
6070
|
},
|
|
5988
|
-
"property-type": "data-
|
|
6071
|
+
"property-type": "data-driven"
|
|
5989
6072
|
},
|
|
5990
6073
|
"fill-extrusion-line-width": {
|
|
5991
6074
|
"type": "number",
|
|
5992
6075
|
"default": 0,
|
|
5993
6076
|
"minimum": 0,
|
|
5994
6077
|
"transition": true,
|
|
6078
|
+
"experimental": true,
|
|
5995
6079
|
"units": "meters",
|
|
5996
6080
|
"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.",
|
|
5997
6081
|
"sdk-support": {
|
|
5998
6082
|
"basic functionality": {
|
|
5999
|
-
"js": "3.7.0"
|
|
6083
|
+
"js": "3.7.0",
|
|
6084
|
+
"android": "11.7.0",
|
|
6085
|
+
"ios": "11.7.0"
|
|
6086
|
+
|
|
6000
6087
|
},
|
|
6001
6088
|
"data-driven styling": {
|
|
6002
|
-
"js": "3.7.0"
|
|
6089
|
+
"js": "3.7.0",
|
|
6090
|
+
"android": "11.7.0",
|
|
6091
|
+
"ios": "11.7.0"
|
|
6003
6092
|
}
|
|
6004
6093
|
},
|
|
6005
6094
|
"expression": {
|
|
@@ -6013,27 +6102,16 @@
|
|
|
6013
6102
|
},
|
|
6014
6103
|
"property-type": "data-driven"
|
|
6015
6104
|
},
|
|
6016
|
-
"fill-extrusion-
|
|
6017
|
-
"type": "
|
|
6018
|
-
"
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
},
|
|
6022
|
-
"outside": {
|
|
6023
|
-
"doc": "Aligns the wall outside of the outline."
|
|
6024
|
-
},
|
|
6025
|
-
"center": {
|
|
6026
|
-
"doc": "Aligns the wall relative to the center of the outline."
|
|
6027
|
-
}
|
|
6028
|
-
},
|
|
6029
|
-
"default": "center",
|
|
6030
|
-
"doc": "Specifies the alignment for offset of the walls relative to the outlines of the geometry. For open-ended line string geometries the positioning is considered based on the ordering of the points, where inside is in clockwise order and outside is counter-clockwise. This property only has an effect if a non-zero fill-extrusion-line-width is used. Center alignment is automatically used for non-closed lines.",
|
|
6031
|
-
"requires": [
|
|
6032
|
-
"fill-extrusion-line-width"
|
|
6033
|
-
],
|
|
6105
|
+
"fill-extrusion-cast-shadows": {
|
|
6106
|
+
"type": "boolean",
|
|
6107
|
+
"default": true,
|
|
6108
|
+
"doc": "Enable/Disable shadow casting for this layer",
|
|
6109
|
+
"transition": false,
|
|
6034
6110
|
"sdk-support": {
|
|
6035
|
-
|
|
6036
|
-
"js": "3.7.0"
|
|
6111
|
+
"basic functionality": {
|
|
6112
|
+
"js": "3.7.0",
|
|
6113
|
+
"android": "11.8.0",
|
|
6114
|
+
"ios": "11.8.0"
|
|
6037
6115
|
}
|
|
6038
6116
|
},
|
|
6039
6117
|
"property-type": "data-constant"
|
|
@@ -7160,7 +7238,8 @@
|
|
|
7160
7238
|
"interpolated": true,
|
|
7161
7239
|
"parameters": [
|
|
7162
7240
|
"zoom",
|
|
7163
|
-
"measure-light"
|
|
7241
|
+
"measure-light",
|
|
7242
|
+
"feature-state"
|
|
7164
7243
|
]
|
|
7165
7244
|
},
|
|
7166
7245
|
"property-type": "data-driven"
|
|
@@ -7191,7 +7270,8 @@
|
|
|
7191
7270
|
"interpolated": true,
|
|
7192
7271
|
"parameters": [
|
|
7193
7272
|
"zoom",
|
|
7194
|
-
"measure-light"
|
|
7273
|
+
"measure-light",
|
|
7274
|
+
"feature-state"
|
|
7195
7275
|
]
|
|
7196
7276
|
},
|
|
7197
7277
|
"property-type": "data-driven"
|
|
@@ -7747,6 +7827,62 @@
|
|
|
7747
7827
|
"interpolated": false
|
|
7748
7828
|
},
|
|
7749
7829
|
"property-type": "data-constant"
|
|
7830
|
+
},
|
|
7831
|
+
"symbol-z-offset": {
|
|
7832
|
+
"type": "number",
|
|
7833
|
+
"doc": "Specifies an uniform elevation from the ground, in meters.",
|
|
7834
|
+
"default": 0,
|
|
7835
|
+
"minimum": 0,
|
|
7836
|
+
"transition": true,
|
|
7837
|
+
"experimental": true,
|
|
7838
|
+
"sdk-support": {
|
|
7839
|
+
"basic functionality": {
|
|
7840
|
+
"js": "3.7.0",
|
|
7841
|
+
"android": "11.7.0",
|
|
7842
|
+
"ios": "11.7.0"
|
|
7843
|
+
},
|
|
7844
|
+
"data-driven styling": {
|
|
7845
|
+
"js": "3.7.0",
|
|
7846
|
+
"android": "11.7.0",
|
|
7847
|
+
"ios": "11.7.0"
|
|
7848
|
+
}
|
|
7849
|
+
},
|
|
7850
|
+
"expression": {
|
|
7851
|
+
"interpolated": true,
|
|
7852
|
+
"parameters": [
|
|
7853
|
+
"zoom",
|
|
7854
|
+
"feature"
|
|
7855
|
+
]
|
|
7856
|
+
},
|
|
7857
|
+
"property-type": "data-driven"
|
|
7858
|
+
},
|
|
7859
|
+
"symbol-elevation-reference": {
|
|
7860
|
+
"type": "enum",
|
|
7861
|
+
"doc": "Selects the base of symbol-elevation.",
|
|
7862
|
+
"values": {
|
|
7863
|
+
"sea": {
|
|
7864
|
+
"doc": "Elevate symbols relative to the sea level."
|
|
7865
|
+
},
|
|
7866
|
+
"ground": {
|
|
7867
|
+
"doc": "Elevate symbols relative to the ground's height below them."
|
|
7868
|
+
}
|
|
7869
|
+
},
|
|
7870
|
+
"default": "ground",
|
|
7871
|
+
"experimental": true,
|
|
7872
|
+
"sdk-support": {
|
|
7873
|
+
"basic functionality": {
|
|
7874
|
+
"js": "3.7.0",
|
|
7875
|
+
"android": "11.7.0",
|
|
7876
|
+
"ios": "11.7.0"
|
|
7877
|
+
}
|
|
7878
|
+
},
|
|
7879
|
+
"expression": {
|
|
7880
|
+
"interpolated": false,
|
|
7881
|
+
"parameters": [
|
|
7882
|
+
"zoom"
|
|
7883
|
+
]
|
|
7884
|
+
},
|
|
7885
|
+
"property-type": "data-constant"
|
|
7750
7886
|
}
|
|
7751
7887
|
},
|
|
7752
7888
|
"paint_raster": {
|
|
@@ -8396,6 +8532,31 @@
|
|
|
8396
8532
|
}
|
|
8397
8533
|
},
|
|
8398
8534
|
"paint_background": {
|
|
8535
|
+
"background-pitch-alignment": {
|
|
8536
|
+
"type": "enum",
|
|
8537
|
+
"values": {
|
|
8538
|
+
"map": {
|
|
8539
|
+
"doc": "The background is aligned to the plane of the map."
|
|
8540
|
+
},
|
|
8541
|
+
"viewport": {
|
|
8542
|
+
"doc": "The background is aligned to the plane of the viewport, covering the whole screen."
|
|
8543
|
+
}
|
|
8544
|
+
},
|
|
8545
|
+
"default": "map",
|
|
8546
|
+
"doc": "Orientation of background layer.",
|
|
8547
|
+
"sdk-support": {
|
|
8548
|
+
"basic functionality": {
|
|
8549
|
+
"js": "3.8.0",
|
|
8550
|
+
"android": "11.8.0",
|
|
8551
|
+
"ios": "11.8.0"
|
|
8552
|
+
}
|
|
8553
|
+
},
|
|
8554
|
+
"expression": {
|
|
8555
|
+
"interpolated": false,
|
|
8556
|
+
"parameters": []
|
|
8557
|
+
},
|
|
8558
|
+
"property-type": "data-constant"
|
|
8559
|
+
},
|
|
8399
8560
|
"background-color": {
|
|
8400
8561
|
"type": "color",
|
|
8401
8562
|
"default": "#000000",
|
|
@@ -9059,9 +9220,7 @@
|
|
|
9059
9220
|
"doc": "An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.",
|
|
9060
9221
|
"sdk-support": {
|
|
9061
9222
|
"basic functionality": {
|
|
9062
|
-
"js": "3.5.0"
|
|
9063
|
-
"android": "11.5.0",
|
|
9064
|
-
"ios": "11.5.0"
|
|
9223
|
+
"js": "3.5.0"
|
|
9065
9224
|
}
|
|
9066
9225
|
}
|
|
9067
9226
|
}
|
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
|
|
|
@@ -97,7 +98,11 @@ export type StyleSpecification = {
|
|
|
97
98
|
"transition"?: TransitionSpecification,
|
|
98
99
|
"projection"?: ProjectionSpecification,
|
|
99
100
|
"layers": Array<LayerSpecification>,
|
|
100
|
-
"models"?: ModelsSpecification
|
|
101
|
+
"models"?: ModelsSpecification,
|
|
102
|
+
/**
|
|
103
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
104
|
+
*/
|
|
105
|
+
"featuresets"?: FeaturesetsSpecification
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
export type SourcesSpecification = {
|
|
@@ -182,6 +187,36 @@ export type OptionSpecification = {
|
|
|
182
187
|
"metadata"?: unknown
|
|
183
188
|
}
|
|
184
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
|
+
|
|
185
220
|
export type VectorSourceSpecification = {
|
|
186
221
|
"type": "vector",
|
|
187
222
|
"url"?: string,
|
|
@@ -312,7 +347,7 @@ export type DirectionalLightSpecification = {
|
|
|
312
347
|
"color-transition"?: TransitionSpecification,
|
|
313
348
|
"intensity"?: PropertyValueSpecification<number>,
|
|
314
349
|
"intensity-transition"?: TransitionSpecification,
|
|
315
|
-
"cast-shadows"?:
|
|
350
|
+
"cast-shadows"?: boolean,
|
|
316
351
|
"shadow-intensity"?: PropertyValueSpecification<number>,
|
|
317
352
|
"shadow-intensity-transition"?: TransitionSpecification
|
|
318
353
|
},
|
|
@@ -365,7 +400,9 @@ export type FillLayerSpecification = {
|
|
|
365
400
|
"fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
366
401
|
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
|
|
367
402
|
"fill-emissive-strength"?: PropertyValueSpecification<number>,
|
|
368
|
-
"fill-emissive-strength-transition"?: TransitionSpecification
|
|
403
|
+
"fill-emissive-strength-transition"?: TransitionSpecification,
|
|
404
|
+
"fill-z-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
405
|
+
"fill-z-offset-transition"?: TransitionSpecification
|
|
369
406
|
}
|
|
370
407
|
}
|
|
371
408
|
|
|
@@ -543,7 +580,13 @@ export type SymbolLayerSpecification = {
|
|
|
543
580
|
"icon-color-saturation"?: ExpressionSpecification,
|
|
544
581
|
"icon-color-contrast"?: ExpressionSpecification,
|
|
545
582
|
"icon-color-brightness-min"?: ExpressionSpecification,
|
|
546
|
-
"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">
|
|
547
590
|
}
|
|
548
591
|
}
|
|
549
592
|
|
|
@@ -699,11 +742,11 @@ export type FillExtrusionLayerSpecification = {
|
|
|
699
742
|
*/
|
|
700
743
|
"fill-extrusion-rounded-roof"?: PropertyValueSpecification<boolean>,
|
|
701
744
|
"fill-extrusion-cutoff-fade-range"?: ExpressionSpecification,
|
|
702
|
-
"fill-extrusion-emissive-strength"?:
|
|
745
|
+
"fill-extrusion-emissive-strength"?: DataDrivenPropertyValueSpecification<number>,
|
|
703
746
|
"fill-extrusion-emissive-strength-transition"?: TransitionSpecification,
|
|
704
747
|
"fill-extrusion-line-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
705
748
|
"fill-extrusion-line-width-transition"?: TransitionSpecification,
|
|
706
|
-
"fill-extrusion-
|
|
749
|
+
"fill-extrusion-cast-shadows"?: boolean
|
|
707
750
|
}
|
|
708
751
|
}
|
|
709
752
|
|
|
@@ -915,6 +958,7 @@ export type BackgroundLayerSpecification = {
|
|
|
915
958
|
"visibility"?: "visible" | "none" | ExpressionSpecification
|
|
916
959
|
},
|
|
917
960
|
"paint"?: {
|
|
961
|
+
"background-pitch-alignment"?: "map" | "viewport" | ExpressionSpecification,
|
|
918
962
|
"background-color"?: PropertyValueSpecification<ColorSpecification>,
|
|
919
963
|
"background-color-transition"?: TransitionSpecification,
|
|
920
964
|
"background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>,
|
|
@@ -1030,6 +1074,10 @@ export type LayerSpecification =
|
|
|
1030
1074
|
| SlotLayerSpecification
|
|
1031
1075
|
| ClipLayerSpecification;
|
|
1032
1076
|
|
|
1077
|
+
export type LayoutSpecification = UnionToIntersection<NonNullable<LayerSpecification['layout']>>;
|
|
1078
|
+
|
|
1079
|
+
export type PaintSpecification = UnionToIntersection<NonNullable<LayerSpecification['paint']>>;
|
|
1080
|
+
|
|
1033
1081
|
// Aliases for easier migration from @types/mapbox-gl
|
|
1034
1082
|
|
|
1035
1083
|
export type Layer = Pick<
|
|
@@ -1128,39 +1176,14 @@ export type SlotLayer = SlotLayerSpecification;
|
|
|
1128
1176
|
export type ClipLayer = ClipLayerSpecification;
|
|
1129
1177
|
|
|
1130
1178
|
/**
|
|
1131
|
-
* @deprecated
|
|
1179
|
+
* @deprecated Use `LayoutSpecification` instead.
|
|
1132
1180
|
*/
|
|
1133
|
-
export type AnyLayout =
|
|
1134
|
-
| FillLayout
|
|
1135
|
-
| LineLayout
|
|
1136
|
-
| SymbolLayout
|
|
1137
|
-
| CircleLayout
|
|
1138
|
-
| HeatmapLayout
|
|
1139
|
-
| FillExtrusionLayout
|
|
1140
|
-
| RasterLayout
|
|
1141
|
-
| RasterParticleLayout
|
|
1142
|
-
| HillshadeLayout
|
|
1143
|
-
| ModelLayout
|
|
1144
|
-
| BackgroundLayout
|
|
1145
|
-
| SkyLayout
|
|
1146
|
-
| ClipLayout;
|
|
1181
|
+
export type AnyLayout = LayoutSpecification;
|
|
1147
1182
|
|
|
1148
1183
|
/**
|
|
1149
|
-
* @deprecated
|
|
1184
|
+
* @deprecated Use `PaintSpecification` instead.
|
|
1150
1185
|
*/
|
|
1151
|
-
export type AnyPaint =
|
|
1152
|
-
| FillPaint
|
|
1153
|
-
| LinePaint
|
|
1154
|
-
| SymbolPaint
|
|
1155
|
-
| CirclePaint
|
|
1156
|
-
| HeatmapPaint
|
|
1157
|
-
| FillExtrusionPaint
|
|
1158
|
-
| RasterPaint
|
|
1159
|
-
| RasterParticlePaint
|
|
1160
|
-
| HillshadePaint
|
|
1161
|
-
| ModelPaint
|
|
1162
|
-
| BackgroundPaint
|
|
1163
|
-
| SkyPaint;
|
|
1186
|
+
export type AnyPaint = PaintSpecification;
|
|
1164
1187
|
|
|
1165
1188
|
/**
|
|
1166
1189
|
* @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';
|
|
@@ -19,7 +19,7 @@ export default function validateFunction(options: ValidationOptions): any {
|
|
|
19
19
|
const functionType = unbundle(options.value.type);
|
|
20
20
|
let stopKeyType;
|
|
21
21
|
let stopDomainValues: Partial<Record<string | number, boolean>> = {};
|
|
22
|
-
let previousStopDomainValue: unknown
|
|
22
|
+
let previousStopDomainValue: unknown;
|
|
23
23
|
let previousStopDomainZoom;
|
|
24
24
|
|
|
25
25
|
const isZoomFunction = functionType !== 'categorical' && options.value.property === undefined;
|
|
@@ -5,9 +5,9 @@ import {isFunction} from '../function/index';
|
|
|
5
5
|
import {unbundle, deepUnbundle} from '../util/unbundle_jsonlint';
|
|
6
6
|
import {supportsLightExpression, supportsPropertyExpression, supportsZoomExpression} from '../util/properties';
|
|
7
7
|
import {isGlobalPropertyConstant, isFeatureConstant, isStateConstant} from '../expression/is_constant';
|
|
8
|
+
import {createPropertyExpression} from '../expression/index';
|
|
8
9
|
|
|
9
10
|
import type {ValidationOptions} from './validate';
|
|
10
|
-
import {createPropertyExpression} from '../expression/index';
|
|
11
11
|
|
|
12
12
|
export type PropertyValidationOptions = ValidationOptions & {
|
|
13
13
|
objectKey: string;
|
|
@@ -42,8 +42,7 @@ export default function validateProperty(options: PropertyValidationOptions, pro
|
|
|
42
42
|
return [new ValidationWarning(key, value, `unknown property "${propertyKey}"`)];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
let tokenMatch: RegExp.matchResult | null | undefined;
|
|
45
|
+
let tokenMatch: RegExpExecArray | undefined;
|
|
47
46
|
if (getType(value) === 'string' && supportsPropertyExpression(valueSpec) && !valueSpec.tokens && (tokenMatch = /^{([^}]+)}$/.exec(value))) {
|
|
48
47
|
const example = `\`{ "type": "identity", "property": ${tokenMatch ? JSON.stringify(tokenMatch[1]) : '"_"'} }\``;
|
|
49
48
|
return [new ValidationError(
|