@mapbox/mapbox-gl-style-spec 14.9.2 → 14.10.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 +101 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -2
- package/dist/index.es.js +101 -4
- package/dist/index.es.js.map +1 -1
- package/group_by_layout.ts +9 -1
- package/package.json +1 -1
- package/reference/v8.json +47 -2
- package/types.ts +28 -2
- package/validate/validate_property.ts +25 -1
- package/validate/validate_source.ts +22 -2
- package/validate_mapbox_api_supported.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -234,6 +234,13 @@
|
|
|
234
234
|
experimental: true,
|
|
235
235
|
type: "featuresets",
|
|
236
236
|
doc: "Defines sets of features for querying, interaction, and state management on the map, referencing individual layers or subsets of layers within the map's style.",
|
|
237
|
+
"sdk-support": {
|
|
238
|
+
"basic functionality": {
|
|
239
|
+
js: "3.9.0",
|
|
240
|
+
android: "11.9.0",
|
|
241
|
+
ios: "11.9.0"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
237
244
|
example: {
|
|
238
245
|
poi: {
|
|
239
246
|
selectors: [
|
|
@@ -266,10 +273,12 @@
|
|
|
266
273
|
var featureset = {
|
|
267
274
|
experimental: true,
|
|
268
275
|
metadata: {
|
|
276
|
+
experimental: true,
|
|
269
277
|
type: "*",
|
|
270
278
|
doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
|
|
271
279
|
},
|
|
272
280
|
selectors: {
|
|
281
|
+
experimental: true,
|
|
273
282
|
type: "array",
|
|
274
283
|
value: "selector",
|
|
275
284
|
doc: "A collection of categorized selectors."
|
|
@@ -278,24 +287,35 @@
|
|
|
278
287
|
var selector = {
|
|
279
288
|
experimental: true,
|
|
280
289
|
layer: {
|
|
290
|
+
experimental: true,
|
|
281
291
|
type: "string",
|
|
282
292
|
doc: "The ID of a layer that exists in the current style.",
|
|
283
293
|
required: true
|
|
284
294
|
},
|
|
285
295
|
properties: {
|
|
296
|
+
experimental: true,
|
|
286
297
|
type: "selectorProperty",
|
|
287
298
|
required: false,
|
|
288
299
|
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."
|
|
289
300
|
},
|
|
290
301
|
featureNamespace: {
|
|
302
|
+
experimental: true,
|
|
291
303
|
type: "string",
|
|
292
304
|
required: false,
|
|
293
305
|
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."
|
|
306
|
+
},
|
|
307
|
+
_uniqueFeatureID: {
|
|
308
|
+
experimental: true,
|
|
309
|
+
type: "boolean",
|
|
310
|
+
"private": true,
|
|
311
|
+
required: false,
|
|
312
|
+
doc: "Internal flag used for standard style, in case multiple features sharing the same featureId, only one feature will be returned for feature query."
|
|
294
313
|
}
|
|
295
314
|
};
|
|
296
315
|
var selectorProperty = {
|
|
297
316
|
experimental: true,
|
|
298
317
|
"*": {
|
|
318
|
+
experimental: true,
|
|
299
319
|
type: "*",
|
|
300
320
|
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."
|
|
301
321
|
}
|
|
@@ -1676,6 +1696,31 @@
|
|
|
1676
1696
|
},
|
|
1677
1697
|
"property-type": "data-driven"
|
|
1678
1698
|
},
|
|
1699
|
+
"circle-elevation-reference": {
|
|
1700
|
+
type: "enum",
|
|
1701
|
+
doc: "Selects the base of circle-elevation. Some modes might require precomputed elevation data in the tileset.",
|
|
1702
|
+
values: {
|
|
1703
|
+
none: {
|
|
1704
|
+
doc: "Elevated rendering is disabled."
|
|
1705
|
+
},
|
|
1706
|
+
"hd-road-markup": {
|
|
1707
|
+
doc: "Elevated rendering is enabled. Use this mode to describe additive and stackable features that should exist only on top of road polygons."
|
|
1708
|
+
}
|
|
1709
|
+
},
|
|
1710
|
+
"default": "none",
|
|
1711
|
+
experimental: true,
|
|
1712
|
+
transition: false,
|
|
1713
|
+
"sdk-support": {
|
|
1714
|
+
"basic functionality": {
|
|
1715
|
+
android: "11.11.0",
|
|
1716
|
+
ios: "11.11.0"
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
expression: {
|
|
1720
|
+
interpolated: false
|
|
1721
|
+
},
|
|
1722
|
+
"property-type": "data-constant"
|
|
1723
|
+
},
|
|
1679
1724
|
visibility: {
|
|
1680
1725
|
type: "enum",
|
|
1681
1726
|
values: {
|
|
@@ -9290,8 +9335,8 @@
|
|
|
9290
9335
|
};
|
|
9291
9336
|
var promoteId = {
|
|
9292
9337
|
"*": {
|
|
9293
|
-
type: "
|
|
9294
|
-
doc: "A name
|
|
9338
|
+
type: "*",
|
|
9339
|
+
doc: "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state."
|
|
9295
9340
|
}
|
|
9296
9341
|
};
|
|
9297
9342
|
var v8 = {
|
|
@@ -19764,6 +19809,30 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19764
19809
|
return [];
|
|
19765
19810
|
const useThemeMatch = propertyKey.match(/^(.*)-use-theme$/);
|
|
19766
19811
|
if (propertyType === 'paint' && useThemeMatch && layerSpec[useThemeMatch[1]]) {
|
|
19812
|
+
if (isExpression(value)) {
|
|
19813
|
+
const errors2 = [];
|
|
19814
|
+
return errors2.concat(validate({
|
|
19815
|
+
key: options.key,
|
|
19816
|
+
value,
|
|
19817
|
+
valueSpec: {
|
|
19818
|
+
'type': 'string',
|
|
19819
|
+
'expression': {
|
|
19820
|
+
'interpolated': false,
|
|
19821
|
+
'parameters': [
|
|
19822
|
+
'zoom',
|
|
19823
|
+
'feature'
|
|
19824
|
+
]
|
|
19825
|
+
},
|
|
19826
|
+
'property-type': 'data-driven'
|
|
19827
|
+
},
|
|
19828
|
+
style,
|
|
19829
|
+
styleSpec,
|
|
19830
|
+
// @ts-expect-error - TS2353 - Object literal may only specify known properties, and 'expressionContext' does not exist in type 'ValidationOptions'.
|
|
19831
|
+
expressionContext: 'property',
|
|
19832
|
+
propertyType,
|
|
19833
|
+
propertyKey
|
|
19834
|
+
}));
|
|
19835
|
+
}
|
|
19767
19836
|
return validate({
|
|
19768
19837
|
key,
|
|
19769
19838
|
value,
|
|
@@ -20093,10 +20162,37 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
20093
20162
|
key,
|
|
20094
20163
|
value
|
|
20095
20164
|
});
|
|
20165
|
+
} else if (Array.isArray(value)) {
|
|
20166
|
+
const errors = [];
|
|
20167
|
+
const unbundledValue = deepUnbundle(value);
|
|
20168
|
+
const expression = createExpression(unbundledValue);
|
|
20169
|
+
if (expression.result === 'error') {
|
|
20170
|
+
expression.value.forEach(err => {
|
|
20171
|
+
errors.push(new ValidationError(`${ key }${ err.key }`, null, `${ err.message }`));
|
|
20172
|
+
});
|
|
20173
|
+
}
|
|
20174
|
+
const parsed = expression.value.expression;
|
|
20175
|
+
const onlyFeatureDependent = isGlobalPropertyConstant(parsed, [
|
|
20176
|
+
'zoom',
|
|
20177
|
+
'heatmap-density',
|
|
20178
|
+
'line-progress',
|
|
20179
|
+
'raster-value',
|
|
20180
|
+
'sky-radial-progress',
|
|
20181
|
+
'accumulated',
|
|
20182
|
+
'is-supported-script',
|
|
20183
|
+
'pitch',
|
|
20184
|
+
'distance-from-center',
|
|
20185
|
+
'measure-light',
|
|
20186
|
+
'raster-particle-speed'
|
|
20187
|
+
]);
|
|
20188
|
+
if (!onlyFeatureDependent) {
|
|
20189
|
+
errors.push(new ValidationError(`${ key }`, null, 'promoteId expression should be only feature dependent'));
|
|
20190
|
+
}
|
|
20191
|
+
return errors;
|
|
20096
20192
|
} else {
|
|
20097
20193
|
const errors = [];
|
|
20098
20194
|
for (const prop in value) {
|
|
20099
|
-
errors.push(...
|
|
20195
|
+
errors.push(...validatePromoteId({
|
|
20100
20196
|
key: `${ key }.${ prop }`,
|
|
20101
20197
|
value: value[prop]
|
|
20102
20198
|
}));
|
|
@@ -21634,7 +21730,8 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
21634
21730
|
const sourceKeys = [
|
|
21635
21731
|
'type',
|
|
21636
21732
|
'url',
|
|
21637
|
-
'tileSize'
|
|
21733
|
+
'tileSize',
|
|
21734
|
+
'promoteId'
|
|
21638
21735
|
];
|
|
21639
21736
|
errors.push(...getAllowedKeyErrors(source, sourceKeys, 'source'));
|
|
21640
21737
|
if (!acceptedSourceTypes.has(String(source.type))) {
|