@mapbox/mapbox-gl-style-spec 14.16.0 → 14.17.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 +34 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +48 -3
- package/dist/index.es.js +34 -29
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/reference/v8.json +7 -4
- package/types.ts +48 -3
- package/validate/validate_filter.ts +28 -17
- package/validate_mapbox_api_supported.ts +3 -6
package/package.json
CHANGED
package/reference/v8.json
CHANGED
|
@@ -1564,7 +1564,6 @@
|
|
|
1564
1564
|
},
|
|
1565
1565
|
"model": {
|
|
1566
1566
|
"doc": "A 3D model",
|
|
1567
|
-
"experimental": true,
|
|
1568
1567
|
"sdk-support": {
|
|
1569
1568
|
"basic functionality": {
|
|
1570
1569
|
"js": "3.0.0",
|
|
@@ -1668,7 +1667,7 @@
|
|
|
1668
1667
|
"type": "array",
|
|
1669
1668
|
"value": "appearance",
|
|
1670
1669
|
"supported-layer-types": ["symbol"],
|
|
1671
|
-
"
|
|
1670
|
+
"experimental": true,
|
|
1672
1671
|
"doc": "Conditional styling applied to symbol layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Works with appearances' are supported."
|
|
1673
1672
|
}
|
|
1674
1673
|
},
|
|
@@ -1677,7 +1676,7 @@
|
|
|
1677
1676
|
"type": "boolean",
|
|
1678
1677
|
"doc": "A boolean expression that determines when this appearance should be applied.",
|
|
1679
1678
|
"expression": {
|
|
1680
|
-
"interpolated":
|
|
1679
|
+
"interpolated": true,
|
|
1681
1680
|
"parameters": [
|
|
1682
1681
|
"zoom",
|
|
1683
1682
|
"pitch",
|
|
@@ -6610,6 +6609,8 @@
|
|
|
6610
6609
|
"indoor": {
|
|
6611
6610
|
"*": {
|
|
6612
6611
|
"type": "indoor_source",
|
|
6612
|
+
"private": true,
|
|
6613
|
+
"experimental": true,
|
|
6613
6614
|
"doc": "Specification of an indoor source - sourceId and sourceLayer required for vector source, for GeoJSON sourceLayers should be omitted."
|
|
6614
6615
|
}
|
|
6615
6616
|
},
|
|
@@ -11397,9 +11398,11 @@
|
|
|
11397
11398
|
"interpolated": false
|
|
11398
11399
|
},
|
|
11399
11400
|
"property-type": "data-constant",
|
|
11400
|
-
"experimental": true,
|
|
11401
11401
|
"sdk-support": {
|
|
11402
11402
|
"basic functionality": {
|
|
11403
|
+
"js": "3.17.0",
|
|
11404
|
+
"android": "11.10.0",
|
|
11405
|
+
"ios": "11.10.0"
|
|
11403
11406
|
}
|
|
11404
11407
|
}
|
|
11405
11408
|
}
|
package/types.ts
CHANGED
|
@@ -329,6 +329,9 @@ export type ImportSpecification = {
|
|
|
329
329
|
};
|
|
330
330
|
|
|
331
331
|
export type IndoorSpecification = {
|
|
332
|
+
/**
|
|
333
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
334
|
+
*/
|
|
332
335
|
[_: string]: IndoorSourceSpecification
|
|
333
336
|
};
|
|
334
337
|
|
|
@@ -668,6 +671,9 @@ export type FillLayerSpecification = {
|
|
|
668
671
|
"fill-tunnel-structure-color-transition"?: TransitionSpecification,
|
|
669
672
|
"fill-tunnel-structure-color-use-theme"?: PropertyValueSpecification<string>
|
|
670
673
|
},
|
|
674
|
+
/**
|
|
675
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
676
|
+
*/
|
|
671
677
|
"appearances"?: Array<AppearanceSpecification>
|
|
672
678
|
};
|
|
673
679
|
|
|
@@ -758,6 +764,9 @@ export type LineLayerSpecification = {
|
|
|
758
764
|
"line-occlusion-opacity"?: PropertyValueSpecification<number>,
|
|
759
765
|
"line-occlusion-opacity-transition"?: TransitionSpecification
|
|
760
766
|
},
|
|
767
|
+
/**
|
|
768
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
769
|
+
*/
|
|
761
770
|
"appearances"?: Array<AppearanceSpecification>
|
|
762
771
|
};
|
|
763
772
|
|
|
@@ -889,6 +898,9 @@ export type SymbolLayerSpecification = {
|
|
|
889
898
|
"symbol-z-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
890
899
|
"symbol-z-offset-transition"?: TransitionSpecification
|
|
891
900
|
},
|
|
901
|
+
/**
|
|
902
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
903
|
+
*/
|
|
892
904
|
"appearances"?: Array<AppearanceSpecification>
|
|
893
905
|
};
|
|
894
906
|
|
|
@@ -945,6 +957,9 @@ export type CircleLayerSpecification = {
|
|
|
945
957
|
"circle-emissive-strength"?: PropertyValueSpecification<number>,
|
|
946
958
|
"circle-emissive-strength-transition"?: TransitionSpecification
|
|
947
959
|
},
|
|
960
|
+
/**
|
|
961
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
962
|
+
*/
|
|
948
963
|
"appearances"?: Array<AppearanceSpecification>
|
|
949
964
|
};
|
|
950
965
|
|
|
@@ -982,6 +997,9 @@ export type HeatmapLayerSpecification = {
|
|
|
982
997
|
"heatmap-opacity"?: PropertyValueSpecification<number>,
|
|
983
998
|
"heatmap-opacity-transition"?: TransitionSpecification
|
|
984
999
|
},
|
|
1000
|
+
/**
|
|
1001
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1002
|
+
*/
|
|
985
1003
|
"appearances"?: Array<AppearanceSpecification>
|
|
986
1004
|
};
|
|
987
1005
|
|
|
@@ -1100,6 +1118,9 @@ export type FillExtrusionLayerSpecification = {
|
|
|
1100
1118
|
"fill-extrusion-line-width-transition"?: TransitionSpecification,
|
|
1101
1119
|
"fill-extrusion-cast-shadows"?: boolean
|
|
1102
1120
|
},
|
|
1121
|
+
/**
|
|
1122
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1123
|
+
*/
|
|
1103
1124
|
"appearances"?: Array<AppearanceSpecification>
|
|
1104
1125
|
};
|
|
1105
1126
|
|
|
@@ -1237,6 +1258,9 @@ export type BuildingLayerSpecification = {
|
|
|
1237
1258
|
"building-flood-light-ground-attenuation"?: PropertyValueSpecification<number>,
|
|
1238
1259
|
"building-flood-light-ground-attenuation-transition"?: TransitionSpecification
|
|
1239
1260
|
},
|
|
1261
|
+
/**
|
|
1262
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1263
|
+
*/
|
|
1240
1264
|
"appearances"?: Array<AppearanceSpecification>
|
|
1241
1265
|
};
|
|
1242
1266
|
|
|
@@ -1296,6 +1320,9 @@ export type RasterLayerSpecification = {
|
|
|
1296
1320
|
"raster-elevation"?: PropertyValueSpecification<number>,
|
|
1297
1321
|
"raster-elevation-transition"?: TransitionSpecification
|
|
1298
1322
|
},
|
|
1323
|
+
/**
|
|
1324
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1325
|
+
*/
|
|
1299
1326
|
"appearances"?: Array<AppearanceSpecification>
|
|
1300
1327
|
};
|
|
1301
1328
|
|
|
@@ -1336,6 +1363,9 @@ export type RasterParticleLayerSpecification = {
|
|
|
1336
1363
|
"raster-particle-elevation"?: PropertyValueSpecification<number>,
|
|
1337
1364
|
"raster-particle-elevation-transition"?: TransitionSpecification
|
|
1338
1365
|
},
|
|
1366
|
+
/**
|
|
1367
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1368
|
+
*/
|
|
1339
1369
|
"appearances"?: Array<AppearanceSpecification>
|
|
1340
1370
|
};
|
|
1341
1371
|
|
|
@@ -1379,6 +1409,9 @@ export type HillshadeLayerSpecification = {
|
|
|
1379
1409
|
"hillshade-emissive-strength"?: PropertyValueSpecification<number>,
|
|
1380
1410
|
"hillshade-emissive-strength-transition"?: TransitionSpecification
|
|
1381
1411
|
},
|
|
1412
|
+
/**
|
|
1413
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1414
|
+
*/
|
|
1382
1415
|
"appearances"?: Array<AppearanceSpecification>
|
|
1383
1416
|
};
|
|
1384
1417
|
|
|
@@ -1433,11 +1466,11 @@ export type ModelLayerSpecification = {
|
|
|
1433
1466
|
"model-height-based-emissive-strength-multiplier-transition"?: TransitionSpecification,
|
|
1434
1467
|
"model-cutoff-fade-range"?: ExpressionSpecification,
|
|
1435
1468
|
"model-front-cutoff"?: PropertyValueSpecification<[number, number, number]>,
|
|
1436
|
-
/**
|
|
1437
|
-
* @experimental This property is experimental and subject to change in future versions.
|
|
1438
|
-
*/
|
|
1439
1469
|
"model-elevation-reference"?: "sea" | "ground" | "hd-road-markup" | ExpressionSpecification
|
|
1440
1470
|
},
|
|
1471
|
+
/**
|
|
1472
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1473
|
+
*/
|
|
1441
1474
|
"appearances"?: Array<AppearanceSpecification>
|
|
1442
1475
|
};
|
|
1443
1476
|
|
|
@@ -1478,6 +1511,9 @@ export type BackgroundLayerSpecification = {
|
|
|
1478
1511
|
"background-emissive-strength"?: PropertyValueSpecification<number>,
|
|
1479
1512
|
"background-emissive-strength-transition"?: TransitionSpecification
|
|
1480
1513
|
},
|
|
1514
|
+
/**
|
|
1515
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1516
|
+
*/
|
|
1481
1517
|
"appearances"?: Array<AppearanceSpecification>
|
|
1482
1518
|
};
|
|
1483
1519
|
|
|
@@ -1519,6 +1555,9 @@ export type SkyLayerSpecification = {
|
|
|
1519
1555
|
"sky-opacity"?: PropertyValueSpecification<number>,
|
|
1520
1556
|
"sky-opacity-transition"?: TransitionSpecification
|
|
1521
1557
|
},
|
|
1558
|
+
/**
|
|
1559
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1560
|
+
*/
|
|
1522
1561
|
"appearances"?: Array<AppearanceSpecification>
|
|
1523
1562
|
};
|
|
1524
1563
|
|
|
@@ -1542,6 +1581,9 @@ export type SlotLayerSpecification = {
|
|
|
1542
1581
|
"minzoom"?: never,
|
|
1543
1582
|
"maxzoom"?: never,
|
|
1544
1583
|
"filter"?: never,
|
|
1584
|
+
/**
|
|
1585
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1586
|
+
*/
|
|
1545
1587
|
"appearances"?: Array<AppearanceSpecification>,
|
|
1546
1588
|
"layout"?: never,
|
|
1547
1589
|
"paint"?: never
|
|
@@ -1561,6 +1603,9 @@ export type ClipLayerSpecification = {
|
|
|
1561
1603
|
"clip-layer-types"?: ExpressionSpecification,
|
|
1562
1604
|
"clip-layer-scope"?: ExpressionSpecification
|
|
1563
1605
|
},
|
|
1606
|
+
/**
|
|
1607
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
1608
|
+
*/
|
|
1564
1609
|
"appearances"?: Array<AppearanceSpecification>,
|
|
1565
1610
|
"paint"?: never
|
|
1566
1611
|
};
|
|
@@ -55,23 +55,7 @@ function validateNonExpressionFilter(options: FilterValidatorOptions): Validatio
|
|
|
55
55
|
valueSpec: styleSpec.filter_operator
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
case '<':
|
|
60
|
-
case '<=':
|
|
61
|
-
case '>':
|
|
62
|
-
case '>=':
|
|
63
|
-
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
64
|
-
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${value[0]}"`));
|
|
65
|
-
}
|
|
66
|
-
/* falls through */
|
|
67
|
-
case '==':
|
|
68
|
-
case '!=':
|
|
69
|
-
if (value.length !== 3) {
|
|
70
|
-
errors.push(new ValidationError(key, value, `filter array for operator "${value[0]}" must have 3 elements`));
|
|
71
|
-
}
|
|
72
|
-
/* falls through */
|
|
73
|
-
case 'in':
|
|
74
|
-
case '!in':
|
|
58
|
+
const validate = () => {
|
|
75
59
|
if (value.length >= 2) {
|
|
76
60
|
if (!isString(value[1])) {
|
|
77
61
|
errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${getType(value[1])} found`));
|
|
@@ -89,6 +73,33 @@ function validateNonExpressionFilter(options: FilterValidatorOptions): Validatio
|
|
|
89
73
|
errors.push(new ValidationError(`${key}[${i}]`, value[i], `string, number, or boolean expected, ${getType(value[i])} found.`));
|
|
90
74
|
}
|
|
91
75
|
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
switch (unbundle(value[0])) {
|
|
79
|
+
case '<':
|
|
80
|
+
case '<=':
|
|
81
|
+
case '>':
|
|
82
|
+
case '>=':
|
|
83
|
+
if (value.length >= 2 && unbundle(value[1]) === '$type') {
|
|
84
|
+
errors.push(new ValidationError(key, value, `"$type" cannot be use with operator "${value[0]}"`));
|
|
85
|
+
}
|
|
86
|
+
if (value.length !== 3) {
|
|
87
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${value[0]}" must have 3 elements`));
|
|
88
|
+
}
|
|
89
|
+
validate();
|
|
90
|
+
break;
|
|
91
|
+
|
|
92
|
+
case '==':
|
|
93
|
+
case '!=':
|
|
94
|
+
if (value.length !== 3) {
|
|
95
|
+
errors.push(new ValidationError(key, value, `filter array for operator "${value[0]}" must have 3 elements`));
|
|
96
|
+
}
|
|
97
|
+
validate();
|
|
98
|
+
break;
|
|
99
|
+
|
|
100
|
+
case 'in':
|
|
101
|
+
case '!in':
|
|
102
|
+
validate();
|
|
92
103
|
break;
|
|
93
104
|
|
|
94
105
|
case 'any':
|
|
@@ -108,10 +108,9 @@ function getSourcesErrors(sources: SourcesSpecification): {
|
|
|
108
108
|
return {errors, sourcesCount};
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
function getImportErrors(imports: ImportSpecification[] = []):
|
|
111
|
+
function getImportErrors(imports: ImportSpecification[] = []): Array<ValidationError> {
|
|
112
112
|
let errors: Array<ValidationError> = [];
|
|
113
113
|
|
|
114
|
-
let sourcesCount = 0;
|
|
115
114
|
const validateImports = (imports: ImportSpecification[] = []) => {
|
|
116
115
|
for (const importSpec of imports) {
|
|
117
116
|
const style = importSpec.data;
|
|
@@ -125,7 +124,6 @@ function getImportErrors(imports: ImportSpecification[] = []): {errors: Array<Va
|
|
|
125
124
|
|
|
126
125
|
if (style.sources) {
|
|
127
126
|
const sourcesErrors = getSourcesErrors(style.sources);
|
|
128
|
-
sourcesCount += sourcesErrors.sourcesCount;
|
|
129
127
|
errors = errors.concat(sourcesErrors.errors);
|
|
130
128
|
}
|
|
131
129
|
}
|
|
@@ -136,7 +134,7 @@ function getImportErrors(imports: ImportSpecification[] = []): {errors: Array<Va
|
|
|
136
134
|
errors.push(new ValidationError(null, null, 'Duplicate ids of imports'));
|
|
137
135
|
}
|
|
138
136
|
|
|
139
|
-
return
|
|
137
|
+
return errors;
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
function getRootErrors(style: MapboxStyleSpecification, specKeys: string[]): Array<ValidationError> {
|
|
@@ -238,8 +236,7 @@ export default function validateMapboxApiSupported(style: MapboxStyleSpecificati
|
|
|
238
236
|
|
|
239
237
|
if (s.imports) {
|
|
240
238
|
const importsErrors = getImportErrors(s.imports);
|
|
241
|
-
|
|
242
|
-
errors = errors.concat(importsErrors.errors);
|
|
239
|
+
errors = errors.concat(importsErrors);
|
|
243
240
|
}
|
|
244
241
|
|
|
245
242
|
errors = errors.concat(getMaxSourcesErrors(sourcesCount));
|