@mapbox/mapbox-gl-style-spec 14.33.0 → 14.34.1-alpha.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 +82 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +67 -12
- package/dist/index.es.js +82 -9
- package/dist/index.es.js.map +1 -1
- package/expression/definitions/config.ts +1 -1
- package/expression/expression_dependencies.ts +5 -2
- package/expression/index.ts +3 -0
- package/package.json +1 -1
- package/reference/v8.json +59 -7
- package/types.ts +15 -9
- package/validate/validate_layer.ts +21 -0
package/dist/index.cjs
CHANGED
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
},
|
|
205
205
|
projection: {
|
|
206
206
|
type: "projection",
|
|
207
|
-
doc: "The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is
|
|
207
|
+
doc: "The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is supported by only Mercator and globe.",
|
|
208
208
|
example: {
|
|
209
209
|
name: "albers",
|
|
210
210
|
center: [
|
|
@@ -2400,7 +2400,6 @@
|
|
|
2400
2400
|
minimum: 0,
|
|
2401
2401
|
units: "meters",
|
|
2402
2402
|
doc: "The height of the procedural buildings.",
|
|
2403
|
-
transition: true,
|
|
2404
2403
|
"private": true,
|
|
2405
2404
|
"sdk-support": {
|
|
2406
2405
|
"basic functionality": {
|
|
@@ -2425,7 +2424,6 @@
|
|
|
2425
2424
|
minimum: 0,
|
|
2426
2425
|
units: "meters",
|
|
2427
2426
|
doc: "The height with which to extrude the base of this layer. Must be less than or equal to `building-height`.",
|
|
2428
|
-
transition: true,
|
|
2429
2427
|
requires: [
|
|
2430
2428
|
"building-height"
|
|
2431
2429
|
],
|
|
@@ -2458,7 +2456,6 @@
|
|
|
2458
2456
|
requires: [
|
|
2459
2457
|
"lights"
|
|
2460
2458
|
],
|
|
2461
|
-
transition: true,
|
|
2462
2459
|
expression: {
|
|
2463
2460
|
interpolated: true,
|
|
2464
2461
|
parameters: [
|
|
@@ -2489,7 +2486,6 @@
|
|
|
2489
2486
|
requires: [
|
|
2490
2487
|
"lights"
|
|
2491
2488
|
],
|
|
2492
|
-
transition: true,
|
|
2493
2489
|
expression: {
|
|
2494
2490
|
interpolated: true,
|
|
2495
2491
|
parameters: [
|
|
@@ -2516,7 +2512,6 @@
|
|
|
2516
2512
|
"private": true,
|
|
2517
2513
|
"default": false,
|
|
2518
2514
|
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.",
|
|
2519
|
-
transition: true,
|
|
2520
2515
|
requires: [
|
|
2521
2516
|
"building-roof-shape"
|
|
2522
2517
|
],
|
|
@@ -2860,7 +2855,6 @@
|
|
|
2860
2855
|
requires: [
|
|
2861
2856
|
"line-z-offset"
|
|
2862
2857
|
],
|
|
2863
|
-
transition: true,
|
|
2864
2858
|
"property-type": "data-driven"
|
|
2865
2859
|
}
|
|
2866
2860
|
};
|
|
@@ -10009,6 +10003,64 @@
|
|
|
10009
10003
|
interpolated: false
|
|
10010
10004
|
},
|
|
10011
10005
|
"property-type": "data-constant"
|
|
10006
|
+
},
|
|
10007
|
+
"raster-mask": {
|
|
10008
|
+
type: "string",
|
|
10009
|
+
required: false,
|
|
10010
|
+
experimental: true,
|
|
10011
|
+
"private": true,
|
|
10012
|
+
doc: "The id of a `fill` layer in the same style whose polygons should clip this layer. Only the geometry is used: set `fill-opacity` to 0 to keep the layer invisible, but don't hide it with `visibility`, `minzoom` or `maxzoom`. To use a featureset from another import, see `raster-mask-import`. Elevated `fill` layers and `raster-elevation` are not supported. This layer is only drawn where the mask's data has loaded, and not at all if the mask can't be used.",
|
|
10013
|
+
example: "water",
|
|
10014
|
+
transition: false,
|
|
10015
|
+
"sdk-support": {
|
|
10016
|
+
"basic functionality": {
|
|
10017
|
+
js: "3.34.0"
|
|
10018
|
+
}
|
|
10019
|
+
},
|
|
10020
|
+
"property-type": "data-constant"
|
|
10021
|
+
},
|
|
10022
|
+
"raster-mask-import": {
|
|
10023
|
+
type: "string",
|
|
10024
|
+
required: false,
|
|
10025
|
+
experimental: true,
|
|
10026
|
+
"private": true,
|
|
10027
|
+
doc: "The id of an import of this style. When set, `raster-mask` is the id of a featureset of that import instead of a layer id, and the mask is made of the `fill` layers the featureset selects. If the featureset can't be found, or selects no `fill` layers, this layer is not drawn.",
|
|
10028
|
+
example: "basemap",
|
|
10029
|
+
transition: false,
|
|
10030
|
+
requires: [
|
|
10031
|
+
"raster-mask"
|
|
10032
|
+
],
|
|
10033
|
+
"sdk-support": {
|
|
10034
|
+
"basic functionality": {
|
|
10035
|
+
js: "3.34.0"
|
|
10036
|
+
}
|
|
10037
|
+
},
|
|
10038
|
+
"property-type": "data-constant"
|
|
10039
|
+
},
|
|
10040
|
+
"raster-mask-mode": {
|
|
10041
|
+
type: "enum",
|
|
10042
|
+
doc: "Whether this layer is drawn inside or outside the mask.",
|
|
10043
|
+
values: {
|
|
10044
|
+
"clip-path-intersect": {
|
|
10045
|
+
doc: "Draw only where the mask layer's geometry covers the map."
|
|
10046
|
+
},
|
|
10047
|
+
"clip-path-exclude": {
|
|
10048
|
+
doc: "Draw only where the mask layer's geometry does not cover the map."
|
|
10049
|
+
}
|
|
10050
|
+
},
|
|
10051
|
+
"default": "clip-path-intersect",
|
|
10052
|
+
experimental: true,
|
|
10053
|
+
"private": true,
|
|
10054
|
+
transition: false,
|
|
10055
|
+
requires: [
|
|
10056
|
+
"raster-mask"
|
|
10057
|
+
],
|
|
10058
|
+
"sdk-support": {
|
|
10059
|
+
"basic functionality": {
|
|
10060
|
+
js: "3.34.0"
|
|
10061
|
+
}
|
|
10062
|
+
},
|
|
10063
|
+
"property-type": "data-constant"
|
|
10012
10064
|
}
|
|
10013
10065
|
};
|
|
10014
10066
|
var paint_hillshade = {
|
|
@@ -15169,7 +15221,7 @@
|
|
|
15169
15221
|
serialize() {
|
|
15170
15222
|
const res = ["config", this.key];
|
|
15171
15223
|
if (this.scope) {
|
|
15172
|
-
res.
|
|
15224
|
+
res.push(this.scope);
|
|
15173
15225
|
}
|
|
15174
15226
|
return res;
|
|
15175
15227
|
}
|
|
@@ -17996,12 +18048,13 @@
|
|
|
17996
18048
|
return;
|
|
17997
18049
|
}
|
|
17998
18050
|
if (e instanceof CompoundExpression && e.name === "is-active-floor") deps.isIndoorDependent = true;
|
|
18051
|
+
if (e instanceof ImageExpression) deps.isImageDependent = true;
|
|
17999
18052
|
e.eachChild((arg) => {
|
|
18000
18053
|
collect(arg, deps);
|
|
18001
18054
|
});
|
|
18002
18055
|
}
|
|
18003
18056
|
function getExpressionDependencies(e) {
|
|
18004
|
-
const deps = { configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false };
|
|
18057
|
+
const deps = { configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false, isImageDependent: false };
|
|
18005
18058
|
collect(e, deps);
|
|
18006
18059
|
return deps;
|
|
18007
18060
|
}
|
|
@@ -18226,6 +18279,7 @@
|
|
|
18226
18279
|
const dependencies = getExpressionDependencies(expression);
|
|
18227
18280
|
this.configDependencies = dependencies.configDependencies;
|
|
18228
18281
|
this.isIndoorDependent = dependencies.isIndoorDependent;
|
|
18282
|
+
this.isImageDependent = dependencies.isImageDependent;
|
|
18229
18283
|
}
|
|
18230
18284
|
evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
|
|
18231
18285
|
const evaluator = this._evaluator;
|
|
@@ -20443,6 +20497,25 @@ Use an identity property function instead: ${example}.`
|
|
|
20443
20497
|
}
|
|
20444
20498
|
}
|
|
20445
20499
|
}
|
|
20500
|
+
if (type === "raster" && isObject(layer.paint)) {
|
|
20501
|
+
const paint = layer.paint;
|
|
20502
|
+
const maskId = unbundle(paint["raster-mask"]);
|
|
20503
|
+
const importId = unbundle(paint["raster-mask-import"]);
|
|
20504
|
+
if (isString(maskId) && maskId) {
|
|
20505
|
+
if (isString(importId) && importId) {
|
|
20506
|
+
if (!(style.imports || []).some((i) => unbundle(i.id) === importId)) {
|
|
20507
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask-import`, paint["raster-mask-import"], `import "${importId}" not found`));
|
|
20508
|
+
}
|
|
20509
|
+
} else {
|
|
20510
|
+
const maskLayer = (style.layers || []).find((l) => unbundle(l.id) === maskId);
|
|
20511
|
+
if (!maskLayer) {
|
|
20512
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask`, paint["raster-mask"], `layer "${maskId}" not found`));
|
|
20513
|
+
} else if (unbundle(maskLayer.type) !== "fill") {
|
|
20514
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask`, paint["raster-mask"], `layer "${maskId}" must be a "fill" layer`));
|
|
20515
|
+
}
|
|
20516
|
+
}
|
|
20517
|
+
}
|
|
20518
|
+
}
|
|
20446
20519
|
errors = errors.concat(validateObject({
|
|
20447
20520
|
key,
|
|
20448
20521
|
value: layer,
|