@mapbox/mapbox-gl-style-spec 14.17.0-beta.2 → 14.18.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 +49 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +362 -185
- package/dist/index.es.js +49 -37
- package/dist/index.es.js.map +1 -1
- package/expression/index.ts +4 -6
- package/function/index.ts +2 -2
- package/package.json +1 -1
- package/read_style.ts +1 -2
- package/reference/v8.json +44 -24
- package/style-spec.ts +13 -11
- package/test.js +1 -2
- package/types.ts +36 -92
- package/util/properties.ts +3 -3
- package/validate_mapbox_api_supported.ts +0 -7
package/expression/index.ts
CHANGED
|
@@ -150,13 +150,11 @@ export class StyleExpression {
|
|
|
150
150
|
}
|
|
151
151
|
return val;
|
|
152
152
|
} catch (e) {
|
|
153
|
-
|
|
154
|
-
if (!this._warningHistory[
|
|
155
|
-
|
|
156
|
-
this._warningHistory[e.message] = true;
|
|
153
|
+
const error = e as Error;
|
|
154
|
+
if (!this._warningHistory[error.message]) {
|
|
155
|
+
this._warningHistory[error.message] = true;
|
|
157
156
|
if (typeof console !== 'undefined') {
|
|
158
|
-
|
|
159
|
-
console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${e.message}`);
|
|
157
|
+
console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${error.message}`);
|
|
160
158
|
}
|
|
161
159
|
}
|
|
162
160
|
return this._defaultValue;
|
package/function/index.ts
CHANGED
|
@@ -129,7 +129,7 @@ export function createFunction(parameters, propertySpec) {
|
|
|
129
129
|
return {
|
|
130
130
|
kind: 'composite',
|
|
131
131
|
interpolationType,
|
|
132
|
-
|
|
132
|
+
|
|
133
133
|
interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),
|
|
134
134
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
|
135
135
|
zoomStops: featureFunctionStops.map(s => s[0]),
|
|
@@ -150,7 +150,7 @@ export function createFunction(parameters, propertySpec) {
|
|
|
150
150
|
return {
|
|
151
151
|
kind: 'camera',
|
|
152
152
|
interpolationType,
|
|
153
|
-
|
|
153
|
+
|
|
154
154
|
interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),
|
|
155
155
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
156
156
|
zoomStops: parameters.stops.map(s => s[0]),
|
package/package.json
CHANGED
package/read_style.ts
CHANGED
|
@@ -8,8 +8,7 @@ export default function readStyle(style: string | Buffer | StyleSpecification):
|
|
|
8
8
|
try {
|
|
9
9
|
return (jsonlint as {parse: (input: string) => StyleSpecification}).parse(style.toString());
|
|
10
10
|
} catch (e) {
|
|
11
|
-
|
|
12
|
-
throw new ParsingError(e);
|
|
11
|
+
throw new ParsingError(e as Error);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
|
package/reference/v8.json
CHANGED
|
@@ -593,6 +593,19 @@
|
|
|
593
593
|
"ios": "11.0.0"
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
+
},
|
|
597
|
+
"shadow-draw-before-layer": {
|
|
598
|
+
"type": "string",
|
|
599
|
+
"property-type": "data-constant",
|
|
600
|
+
"doc": "Specify a layer before which shadows are drawn on the ground. If not specified, shadows are drawn after the last 3D layer. This property does not affect shadows on terrain.",
|
|
601
|
+
"sdk-support": {
|
|
602
|
+
"basic functionality": {
|
|
603
|
+
"js": "3.18.0",
|
|
604
|
+
"android": "11.18.0",
|
|
605
|
+
"ios": "11.18.0"
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
"experimental": true
|
|
596
609
|
}
|
|
597
610
|
},
|
|
598
611
|
"properties_light_ambient": {
|
|
@@ -1428,6 +1441,10 @@
|
|
|
1428
1441
|
},
|
|
1429
1442
|
"doc": "Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."
|
|
1430
1443
|
},
|
|
1444
|
+
"url": {
|
|
1445
|
+
"type": "string",
|
|
1446
|
+
"doc": "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`. Required if `tiles` is not provided."
|
|
1447
|
+
},
|
|
1431
1448
|
"maxzoom": {
|
|
1432
1449
|
"type": "number",
|
|
1433
1450
|
"default": 18,
|
|
@@ -1524,7 +1541,6 @@
|
|
|
1524
1541
|
"android": "11.16.0",
|
|
1525
1542
|
"ios": "11.16.0"
|
|
1526
1543
|
},
|
|
1527
|
-
"experimental": true,
|
|
1528
1544
|
"private": true
|
|
1529
1545
|
},
|
|
1530
1546
|
"raster": {
|
|
@@ -1829,6 +1845,21 @@
|
|
|
1829
1845
|
"vector"
|
|
1830
1846
|
]
|
|
1831
1847
|
}]
|
|
1848
|
+
},
|
|
1849
|
+
"model-allow-density-reduction": {
|
|
1850
|
+
"type": "boolean",
|
|
1851
|
+
"default": true,
|
|
1852
|
+
"transition": false,
|
|
1853
|
+
"experimental": true,
|
|
1854
|
+
"doc": "If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render.",
|
|
1855
|
+
"sdk-support": {
|
|
1856
|
+
"basic functionality": {
|
|
1857
|
+
"js": "0.10.0",
|
|
1858
|
+
"android": "2.0.1",
|
|
1859
|
+
"ios": "2.0.0"
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
"property-type": "data-constant"
|
|
1832
1863
|
}
|
|
1833
1864
|
},
|
|
1834
1865
|
"layout_clip": {
|
|
@@ -2167,6 +2198,7 @@
|
|
|
2167
2198
|
},
|
|
2168
2199
|
"default": "visible",
|
|
2169
2200
|
"doc": "Whether this layer is displayed.",
|
|
2201
|
+
"private": true,
|
|
2170
2202
|
"sdk-support": {
|
|
2171
2203
|
"basic functionality": {
|
|
2172
2204
|
"js": "3.16.0",
|
|
@@ -2183,7 +2215,6 @@
|
|
|
2183
2215
|
"type": "boolean",
|
|
2184
2216
|
"default": false,
|
|
2185
2217
|
"doc": "Whether to render facade details on the buildings.",
|
|
2186
|
-
"experimental": true,
|
|
2187
2218
|
"private": true,
|
|
2188
2219
|
"sdk-support": {
|
|
2189
2220
|
"basic functionality": {
|
|
@@ -2211,7 +2242,7 @@
|
|
|
2211
2242
|
"maximum": 200,
|
|
2212
2243
|
"default": 3,
|
|
2213
2244
|
"doc": "Number of floors created when building-facade is enabled.",
|
|
2214
|
-
"
|
|
2245
|
+
"private": true,
|
|
2215
2246
|
"property-type": "data-driven",
|
|
2216
2247
|
"sdk-support": {
|
|
2217
2248
|
"basic functionality": {
|
|
@@ -2241,7 +2272,7 @@
|
|
|
2241
2272
|
"maximum": 20.0,
|
|
2242
2273
|
"default": 3.1,
|
|
2243
2274
|
"doc": "Width of a floor. Think of this as measure how wide each unit should be. This effectively determines the number of units per each floor. Note that this does not affect the ground level facades (i.e. number of windows).",
|
|
2244
|
-
"
|
|
2275
|
+
"private": true,
|
|
2245
2276
|
"property-type": "data-driven",
|
|
2246
2277
|
"sdk-support": {
|
|
2247
2278
|
"basic functionality": {
|
|
@@ -2273,7 +2304,7 @@
|
|
|
2273
2304
|
"maximum": 1.0,
|
|
2274
2305
|
"default": [0.9, 0.9],
|
|
2275
2306
|
"doc": "Given as fractions, specifies the percentage of unit area covered by windows when building-facade is enabled. Note that the area of a unit is ultimately determined by `building-facade-unit-width` and `building-facade-floors`.",
|
|
2276
|
-
"
|
|
2307
|
+
"private": true,
|
|
2277
2308
|
"property-type": "data-driven",
|
|
2278
2309
|
"sdk-support": {
|
|
2279
2310
|
"basic functionality": {
|
|
@@ -2324,7 +2355,6 @@
|
|
|
2324
2355
|
},
|
|
2325
2356
|
"default": "flat",
|
|
2326
2357
|
"doc": "Roof type to use for the procedural buildings.",
|
|
2327
|
-
"experimental": true,
|
|
2328
2358
|
"private": true,
|
|
2329
2359
|
"sdk-support": {
|
|
2330
2360
|
"basic functionality": {
|
|
@@ -2353,7 +2383,6 @@
|
|
|
2353
2383
|
"units": "meters",
|
|
2354
2384
|
"doc": "The height of the procedural buildings.",
|
|
2355
2385
|
"transition": true,
|
|
2356
|
-
"experimental": true,
|
|
2357
2386
|
"private": true,
|
|
2358
2387
|
"sdk-support": {
|
|
2359
2388
|
"basic functionality": {
|
|
@@ -2382,7 +2411,6 @@
|
|
|
2382
2411
|
"requires": [
|
|
2383
2412
|
"building-height"
|
|
2384
2413
|
],
|
|
2385
|
-
"experimental": true,
|
|
2386
2414
|
"private": true,
|
|
2387
2415
|
"sdk-support": {
|
|
2388
2416
|
"basic functionality": {
|
|
@@ -2404,7 +2432,7 @@
|
|
|
2404
2432
|
"building-flood-light-wall-radius": {
|
|
2405
2433
|
"property-type": "data-driven",
|
|
2406
2434
|
"type": "number",
|
|
2407
|
-
"
|
|
2435
|
+
"private": true,
|
|
2408
2436
|
"units": "meters",
|
|
2409
2437
|
"default": 0,
|
|
2410
2438
|
"minimum": 0,
|
|
@@ -2436,7 +2464,7 @@
|
|
|
2436
2464
|
"building-flood-light-ground-radius": {
|
|
2437
2465
|
"property-type": "data-driven",
|
|
2438
2466
|
"type": "number",
|
|
2439
|
-
"
|
|
2467
|
+
"private": true,
|
|
2440
2468
|
"units": "meters",
|
|
2441
2469
|
"default": 0,
|
|
2442
2470
|
"doc": "The extent of the flood light effect on the ground beneath the buildings in meters.",
|
|
@@ -2467,7 +2495,7 @@
|
|
|
2467
2495
|
"building-flip-roof-orientation": {
|
|
2468
2496
|
"property-type": "data-driven",
|
|
2469
2497
|
"type": "boolean",
|
|
2470
|
-
"
|
|
2498
|
+
"private": true,
|
|
2471
2499
|
"units": "meters",
|
|
2472
2500
|
"default": false,
|
|
2473
2501
|
"doc": "Flips the orientation of the roofs for the buildings. This only affects simple geometries. Namely buildings whose footprints form a quadrilateral. By default (false), the roof ridge takes the direction of the longer edge of the quadrilateral.",
|
|
@@ -7915,7 +7943,6 @@
|
|
|
7915
7943
|
"maximum": 1,
|
|
7916
7944
|
"doc": "The opacity of the entire procedural buildings layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",
|
|
7917
7945
|
"transition": true,
|
|
7918
|
-
"experimental": true,
|
|
7919
7946
|
"private": true,
|
|
7920
7947
|
"sdk-support": {
|
|
7921
7948
|
"basic functionality": {
|
|
@@ -7938,7 +7965,6 @@
|
|
|
7938
7965
|
"default": 0,
|
|
7939
7966
|
"minimum": 0,
|
|
7940
7967
|
"maximum": 1,
|
|
7941
|
-
"experimental": true,
|
|
7942
7968
|
"private": true,
|
|
7943
7969
|
"expression": {
|
|
7944
7970
|
"interpolated": false,
|
|
@@ -7961,7 +7987,6 @@
|
|
|
7961
7987
|
"default": 0,
|
|
7962
7988
|
"minimum": 0,
|
|
7963
7989
|
"maximum": 1,
|
|
7964
|
-
"experimental": true,
|
|
7965
7990
|
"private": true,
|
|
7966
7991
|
"expression": {
|
|
7967
7992
|
"interpolated": true,
|
|
@@ -7982,7 +8007,6 @@
|
|
|
7982
8007
|
"building-ambient-occlusion-ground-radius": {
|
|
7983
8008
|
"property-type": "data-constant",
|
|
7984
8009
|
"type": "number",
|
|
7985
|
-
"experimental": true,
|
|
7986
8010
|
"private": true,
|
|
7987
8011
|
"default": 3.0,
|
|
7988
8012
|
"minimum": 0,
|
|
@@ -8005,7 +8029,6 @@
|
|
|
8005
8029
|
"building-ambient-occlusion-ground-attenuation": {
|
|
8006
8030
|
"property-type": "data-constant",
|
|
8007
8031
|
"type": "number",
|
|
8008
|
-
"experimental": true,
|
|
8009
8032
|
"private": true,
|
|
8010
8033
|
"default": 0.69,
|
|
8011
8034
|
"minimum": 0.0,
|
|
@@ -8029,7 +8052,6 @@
|
|
|
8029
8052
|
"building-vertical-scale": {
|
|
8030
8053
|
"property-type": "data-constant",
|
|
8031
8054
|
"type": "number",
|
|
8032
|
-
"experimental": true,
|
|
8033
8055
|
"private": true,
|
|
8034
8056
|
"default": 1.0,
|
|
8035
8057
|
"minimum": 0.0,
|
|
@@ -8054,7 +8076,6 @@
|
|
|
8054
8076
|
"default": true,
|
|
8055
8077
|
"doc": "Enable/Disable shadow casting for this layer",
|
|
8056
8078
|
"transition": false,
|
|
8057
|
-
"experimental": true,
|
|
8058
8079
|
"private": true,
|
|
8059
8080
|
"sdk-support": {
|
|
8060
8081
|
"basic functionality": {
|
|
@@ -8069,7 +8090,6 @@
|
|
|
8069
8090
|
"type": "color",
|
|
8070
8091
|
"default": "rgba(193, 154, 127, 1)",
|
|
8071
8092
|
"doc": "Color buildings. This can be styled using different building parts (e.g. window, wall, roof).",
|
|
8072
|
-
"experimental": true,
|
|
8073
8093
|
"private": true,
|
|
8074
8094
|
"use-theme": true,
|
|
8075
8095
|
"transition": false,
|
|
@@ -8102,7 +8122,6 @@
|
|
|
8102
8122
|
"maximum": 5,
|
|
8103
8123
|
"units": "intensity",
|
|
8104
8124
|
"doc": "Controls the intensity of light emitted on the source features. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors).",
|
|
8105
|
-
"experimental": true,
|
|
8106
8125
|
"private": true,
|
|
8107
8126
|
"sdk-support": {
|
|
8108
8127
|
"basic functionality": {
|
|
@@ -8132,7 +8151,7 @@
|
|
|
8132
8151
|
"minimum": 0,
|
|
8133
8152
|
"maximum": 1,
|
|
8134
8153
|
"doc": "Given as a fraction specifies the likelihood for the facades to be emissive when building-facade is enabled. A value of 0.0 means the window will never be emissive, while a value of 1.0 means the window will always be emissive. This can be used to create variations on a building where some windows are lit and some are not.",
|
|
8135
|
-
"
|
|
8154
|
+
"private": true,
|
|
8136
8155
|
"property-type": "data-constant",
|
|
8137
8156
|
"sdk-support": {
|
|
8138
8157
|
"basic functionality": {
|
|
@@ -8151,6 +8170,7 @@
|
|
|
8151
8170
|
},
|
|
8152
8171
|
"building-cutoff-fade-range": {
|
|
8153
8172
|
"type": "number",
|
|
8173
|
+
"private": true,
|
|
8154
8174
|
"default": 0.0,
|
|
8155
8175
|
"minimum": 0.0,
|
|
8156
8176
|
"maximum": 1.0,
|
|
@@ -8171,7 +8191,7 @@
|
|
|
8171
8191
|
"building-flood-light-color": {
|
|
8172
8192
|
"property-type": "data-constant",
|
|
8173
8193
|
"type": "color",
|
|
8174
|
-
"
|
|
8194
|
+
"private": true,
|
|
8175
8195
|
"default": "#ffffff",
|
|
8176
8196
|
"doc": "The color of the flood light effect on the walls of the buildings.",
|
|
8177
8197
|
"requires": [
|
|
@@ -8197,7 +8217,7 @@
|
|
|
8197
8217
|
"building-flood-light-intensity": {
|
|
8198
8218
|
"property-type": "data-constant",
|
|
8199
8219
|
"type": "number",
|
|
8200
|
-
"
|
|
8220
|
+
"private": true,
|
|
8201
8221
|
"default": 0.0,
|
|
8202
8222
|
"minimum": 0.0,
|
|
8203
8223
|
"maximum": 1.0,
|
|
@@ -8224,7 +8244,7 @@
|
|
|
8224
8244
|
"building-flood-light-ground-attenuation": {
|
|
8225
8245
|
"property-type": "data-constant",
|
|
8226
8246
|
"type": "number",
|
|
8227
|
-
"
|
|
8247
|
+
"private": true,
|
|
8228
8248
|
"default": 0.69,
|
|
8229
8249
|
"minimum": 0.0,
|
|
8230
8250
|
"maximum": 1.0,
|
package/style-spec.ts
CHANGED
|
@@ -17,6 +17,8 @@ import {eachSource, eachLayer, eachProperty} from './visit';
|
|
|
17
17
|
import validate from './validate_style';
|
|
18
18
|
import validateMapboxApiSupported from './validate_mapbox_api_supported';
|
|
19
19
|
|
|
20
|
+
export type * from './types';
|
|
21
|
+
|
|
20
22
|
type ExpressionType = 'data-driven' | 'color-ramp' | 'data-constant' | 'constant';
|
|
21
23
|
|
|
22
24
|
type ExpressionParameter =
|
|
@@ -32,7 +34,7 @@ type ExpressionParameter =
|
|
|
32
34
|
| 'distance-from-center'
|
|
33
35
|
| 'raster-particle-speed';
|
|
34
36
|
|
|
35
|
-
export type
|
|
37
|
+
export type PropertyExpressionSpecification = {
|
|
36
38
|
interpolated: boolean,
|
|
37
39
|
parameters?: ExpressionParameter[],
|
|
38
40
|
relaxZoomRestriction?: boolean
|
|
@@ -43,7 +45,7 @@ export type ArrayPropertySpecification =
|
|
|
43
45
|
type: 'array';
|
|
44
46
|
'property-type': ExpressionType;
|
|
45
47
|
value: 'enum';
|
|
46
|
-
expression?:
|
|
48
|
+
expression?: PropertyExpressionSpecification,
|
|
47
49
|
transition?: boolean,
|
|
48
50
|
default?: string[],
|
|
49
51
|
length?: number,
|
|
@@ -59,7 +61,7 @@ export type ArrayPropertySpecification =
|
|
|
59
61
|
type: 'array';
|
|
60
62
|
'property-type': ExpressionType;
|
|
61
63
|
value: 'number';
|
|
62
|
-
expression?:
|
|
64
|
+
expression?: PropertyExpressionSpecification;
|
|
63
65
|
transition?: boolean;
|
|
64
66
|
default?: number[];
|
|
65
67
|
minimum?: number;
|
|
@@ -77,7 +79,7 @@ export type ArrayPropertySpecification =
|
|
|
77
79
|
type: 'array';
|
|
78
80
|
'property-type': ExpressionType;
|
|
79
81
|
value: 'string';
|
|
80
|
-
expression?:
|
|
82
|
+
expression?: PropertyExpressionSpecification;
|
|
81
83
|
transition?: boolean;
|
|
82
84
|
default?: string[];
|
|
83
85
|
length?: number;
|
|
@@ -94,7 +96,7 @@ export type ArrayPropertySpecification =
|
|
|
94
96
|
export type BooleanPropertySpecification = {
|
|
95
97
|
type: 'boolean';
|
|
96
98
|
'property-type': ExpressionType;
|
|
97
|
-
expression?:
|
|
99
|
+
expression?: PropertyExpressionSpecification;
|
|
98
100
|
transition?: boolean;
|
|
99
101
|
default?: boolean;
|
|
100
102
|
overridable?: boolean;
|
|
@@ -108,7 +110,7 @@ export type BooleanPropertySpecification = {
|
|
|
108
110
|
export type ColorPropertySpecification = {
|
|
109
111
|
type: 'color';
|
|
110
112
|
'property-type': ExpressionType;
|
|
111
|
-
expression?:
|
|
113
|
+
expression?: PropertyExpressionSpecification;
|
|
112
114
|
transition?: boolean;
|
|
113
115
|
default?: string;
|
|
114
116
|
'use-theme'?: boolean;
|
|
@@ -123,7 +125,7 @@ export type ColorPropertySpecification = {
|
|
|
123
125
|
export type EnumPropertySpecification = {
|
|
124
126
|
type: 'enum';
|
|
125
127
|
'property-type': ExpressionType;
|
|
126
|
-
expression?:
|
|
128
|
+
expression?: PropertyExpressionSpecification;
|
|
127
129
|
transition?: boolean;
|
|
128
130
|
default?: string;
|
|
129
131
|
values?: {[_: string]: unknown};
|
|
@@ -137,7 +139,7 @@ export type EnumPropertySpecification = {
|
|
|
137
139
|
export type FormattedPropertySpecification = {
|
|
138
140
|
type: 'formatted';
|
|
139
141
|
'property-type': ExpressionType;
|
|
140
|
-
expression?:
|
|
142
|
+
expression?: PropertyExpressionSpecification;
|
|
141
143
|
transition?: boolean;
|
|
142
144
|
default?: string;
|
|
143
145
|
tokens?: boolean;
|
|
@@ -150,7 +152,7 @@ export type FormattedPropertySpecification = {
|
|
|
150
152
|
export type NumberPropertySpecification = {
|
|
151
153
|
type: 'number';
|
|
152
154
|
'property-type': ExpressionType;
|
|
153
|
-
expression?:
|
|
155
|
+
expression?: PropertyExpressionSpecification;
|
|
154
156
|
transition?: boolean;
|
|
155
157
|
default?: number;
|
|
156
158
|
minimum?: number;
|
|
@@ -167,7 +169,7 @@ export type NumberPropertySpecification = {
|
|
|
167
169
|
export type ResolvedImagePropertySpecification = {
|
|
168
170
|
type: 'resolvedImage';
|
|
169
171
|
'property-type': ExpressionType;
|
|
170
|
-
expression?:
|
|
172
|
+
expression?: PropertyExpressionSpecification;
|
|
171
173
|
transition?: boolean;
|
|
172
174
|
default?: string;
|
|
173
175
|
tokens?: boolean;
|
|
@@ -181,7 +183,7 @@ export type ResolvedImagePropertySpecification = {
|
|
|
181
183
|
export type StringPropertySpecification = {
|
|
182
184
|
type: 'string';
|
|
183
185
|
'property-type': ExpressionType;
|
|
184
|
-
expression?:
|
|
186
|
+
expression?: PropertyExpressionSpecification;
|
|
185
187
|
transition?: boolean;
|
|
186
188
|
default?: string;
|
|
187
189
|
tokens?: boolean;
|
package/test.js
CHANGED