@mapbox/mapbox-gl-style-spec 13.27.0 → 13.28.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 +23 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +23 -33
- package/dist/index.es.js.map +1 -1
- package/expression/index.js +1 -1
- package/package.json +1 -1
- package/reference/v8.json +11 -20
- package/style-spec.js +1 -1
- package/util/properties.js +1 -1
- package/validate/validate_source.js +11 -1
- package/validate_mapbox_api_supported.js +2 -2
package/expression/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export type Feature = {
|
|
|
33
33
|
+type: 1 | 2 | 3 | 'Unknown' | 'Point' | 'LineString' | 'Polygon',
|
|
34
34
|
+id?: number | null,
|
|
35
35
|
+properties: {[_: string]: any},
|
|
36
|
-
+patterns?: {[_: string]:
|
|
36
|
+
+patterns?: {[_: string]: string},
|
|
37
37
|
+geometry?: Array<Array<Point>>
|
|
38
38
|
};
|
|
39
39
|
|
package/package.json
CHANGED
package/reference/v8.json
CHANGED
|
@@ -4431,7 +4431,7 @@
|
|
|
4431
4431
|
},
|
|
4432
4432
|
"fill-pattern": {
|
|
4433
4433
|
"type": "resolvedImage",
|
|
4434
|
-
"transition":
|
|
4434
|
+
"transition": false,
|
|
4435
4435
|
"doc": "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
|
4436
4436
|
"sdk-support": {
|
|
4437
4437
|
"basic functionality": {
|
|
@@ -4454,7 +4454,7 @@
|
|
|
4454
4454
|
"feature"
|
|
4455
4455
|
]
|
|
4456
4456
|
},
|
|
4457
|
-
"property-type": "
|
|
4457
|
+
"property-type": "data-driven"
|
|
4458
4458
|
}
|
|
4459
4459
|
},
|
|
4460
4460
|
"paint_fill-extrusion": {
|
|
@@ -4575,7 +4575,7 @@
|
|
|
4575
4575
|
},
|
|
4576
4576
|
"fill-extrusion-pattern": {
|
|
4577
4577
|
"type": "resolvedImage",
|
|
4578
|
-
"transition":
|
|
4578
|
+
"transition": false,
|
|
4579
4579
|
"doc": "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
|
4580
4580
|
"sdk-support": {
|
|
4581
4581
|
"basic functionality": {
|
|
@@ -4598,7 +4598,7 @@
|
|
|
4598
4598
|
"feature"
|
|
4599
4599
|
]
|
|
4600
4600
|
},
|
|
4601
|
-
"property-type": "
|
|
4601
|
+
"property-type": "data-driven"
|
|
4602
4602
|
},
|
|
4603
4603
|
"fill-extrusion-height": {
|
|
4604
4604
|
"type": "number",
|
|
@@ -4987,7 +4987,7 @@
|
|
|
4987
4987
|
"value": "number",
|
|
4988
4988
|
"doc": "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
|
4989
4989
|
"minimum": 0,
|
|
4990
|
-
"transition":
|
|
4990
|
+
"transition": false,
|
|
4991
4991
|
"units": "line widths",
|
|
4992
4992
|
"requires": [
|
|
4993
4993
|
{
|
|
@@ -5012,11 +5012,11 @@
|
|
|
5012
5012
|
"feature"
|
|
5013
5013
|
]
|
|
5014
5014
|
},
|
|
5015
|
-
"property-type": "
|
|
5015
|
+
"property-type": "data-driven"
|
|
5016
5016
|
},
|
|
5017
5017
|
"line-pattern": {
|
|
5018
5018
|
"type": "resolvedImage",
|
|
5019
|
-
"transition":
|
|
5019
|
+
"transition": false,
|
|
5020
5020
|
"doc": "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
|
5021
5021
|
"sdk-support": {
|
|
5022
5022
|
"basic functionality": {
|
|
@@ -5039,7 +5039,7 @@
|
|
|
5039
5039
|
"feature"
|
|
5040
5040
|
]
|
|
5041
5041
|
},
|
|
5042
|
-
"property-type": "
|
|
5042
|
+
"property-type": "data-driven"
|
|
5043
5043
|
},
|
|
5044
5044
|
"line-gradient": {
|
|
5045
5045
|
"type": "color",
|
|
@@ -6396,7 +6396,7 @@
|
|
|
6396
6396
|
},
|
|
6397
6397
|
"background-pattern": {
|
|
6398
6398
|
"type": "resolvedImage",
|
|
6399
|
-
"transition":
|
|
6399
|
+
"transition": false,
|
|
6400
6400
|
"doc": "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
|
|
6401
6401
|
"sdk-support": {
|
|
6402
6402
|
"basic functionality": {
|
|
@@ -6404,8 +6404,7 @@
|
|
|
6404
6404
|
"android": "2.0.1",
|
|
6405
6405
|
"ios": "2.0.0",
|
|
6406
6406
|
"macos": "0.1.0"
|
|
6407
|
-
}
|
|
6408
|
-
"data-driven styling": {}
|
|
6407
|
+
}
|
|
6409
6408
|
},
|
|
6410
6409
|
"expression": {
|
|
6411
6410
|
"interpolated": false,
|
|
@@ -6413,7 +6412,7 @@
|
|
|
6413
6412
|
"zoom"
|
|
6414
6413
|
]
|
|
6415
6414
|
},
|
|
6416
|
-
"property-type": "
|
|
6415
|
+
"property-type": "data-constant"
|
|
6417
6416
|
},
|
|
6418
6417
|
"background-opacity": {
|
|
6419
6418
|
"type": "number",
|
|
@@ -6697,14 +6696,6 @@
|
|
|
6697
6696
|
"type": "property-type",
|
|
6698
6697
|
"doc": "Property is interpolable and can be represented using a property expression."
|
|
6699
6698
|
},
|
|
6700
|
-
"cross-faded": {
|
|
6701
|
-
"type": "property-type",
|
|
6702
|
-
"doc": "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."
|
|
6703
|
-
},
|
|
6704
|
-
"cross-faded-data-driven": {
|
|
6705
|
-
"type": "property-type",
|
|
6706
|
-
"doc": "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."
|
|
6707
|
-
},
|
|
6708
6699
|
"color-ramp": {
|
|
6709
6700
|
"type": "property-type",
|
|
6710
6701
|
"doc": "Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."
|
package/style-spec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
type ExpressionType = 'data-driven' | '
|
|
3
|
+
type ExpressionType = 'data-driven' | 'color-ramp' | 'data-constant' | 'constant';
|
|
4
4
|
type ExpressionParameters = Array<'zoom' | 'feature' | 'feature-state' | 'heatmap-density' | 'line-progress' | 'sky-radial-progress' | 'pitch' | 'distance-from-center'>;
|
|
5
5
|
|
|
6
6
|
type ExpressionSpecification = {
|
package/util/properties.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type {StylePropertySpecification} from '../style-spec.js';
|
|
4
4
|
|
|
5
5
|
export function supportsPropertyExpression(spec: StylePropertySpecification): boolean {
|
|
6
|
-
return spec['property-type'] === 'data-driven'
|
|
6
|
+
return spec['property-type'] === 'data-driven';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function supportsZoomExpression(spec: StylePropertySpecification): boolean {
|
|
@@ -94,13 +94,23 @@ export default function validateSource(options: ValidationOptions): Array<Valida
|
|
|
94
94
|
return validateEnum({
|
|
95
95
|
key: `${key}.type`,
|
|
96
96
|
value: value.type,
|
|
97
|
-
valueSpec: {values:
|
|
97
|
+
valueSpec: {values: getSourceTypeValues(styleSpec)},
|
|
98
98
|
style,
|
|
99
99
|
styleSpec
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
function getSourceTypeValues(styleSpec) {
|
|
105
|
+
return styleSpec.source.reduce((memo, source) => {
|
|
106
|
+
const sourceType = styleSpec[source];
|
|
107
|
+
if (sourceType.type.type === 'enum') {
|
|
108
|
+
memo = memo.concat(Object.keys(sourceType.type.values));
|
|
109
|
+
}
|
|
110
|
+
return memo;
|
|
111
|
+
}, []);
|
|
112
|
+
}
|
|
113
|
+
|
|
104
114
|
function validatePromoteId({key, value}) {
|
|
105
115
|
if (getType(value) === 'string') {
|
|
106
116
|
return validateString({key, value});
|
|
@@ -167,7 +167,7 @@ function getRootErrors(style: Object, specKeys: Array<any>): Array<ValidationErr
|
|
|
167
167
|
* var validateMapboxApiSupported = require('mapbox-gl-style-spec/lib/validate_style_mapbox_api_supported.js');
|
|
168
168
|
* var errors = validateMapboxApiSupported(style);
|
|
169
169
|
*/
|
|
170
|
-
export default function validateMapboxApiSupported(style: Object): ValidationErrors {
|
|
170
|
+
export default function validateMapboxApiSupported(style: Object, styleSpec: Object = v8): ValidationErrors {
|
|
171
171
|
let s = style;
|
|
172
172
|
try {
|
|
173
173
|
s = readStyle(s);
|
|
@@ -175,7 +175,7 @@ export default function validateMapboxApiSupported(style: Object): ValidationErr
|
|
|
175
175
|
return [e];
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
let errors = validateStyle(s,
|
|
178
|
+
let errors = validateStyle(s, styleSpec)
|
|
179
179
|
.concat(getRootErrors(s, Object.keys(v8.$root)));
|
|
180
180
|
|
|
181
181
|
if (s.sources) {
|