@mapbox/mapbox-gl-style-spec 14.34.0-rc.1 → 14.34.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 +77 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +66 -0
- package/dist/index.es.js +77 -0
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/reference/v8.json +58 -0
- package/types.ts +13 -1
- package/validate/validate_layer.ts +21 -0
package/dist/index.d.ts
CHANGED
|
@@ -9544,6 +9544,60 @@ declare const _exports: {
|
|
|
9544
9544
|
};
|
|
9545
9545
|
"property-type": string;
|
|
9546
9546
|
};
|
|
9547
|
+
"raster-mask": {
|
|
9548
|
+
type: string;
|
|
9549
|
+
required: boolean;
|
|
9550
|
+
experimental: boolean;
|
|
9551
|
+
private: boolean;
|
|
9552
|
+
doc: string;
|
|
9553
|
+
example: string;
|
|
9554
|
+
transition: boolean;
|
|
9555
|
+
"sdk-support": {
|
|
9556
|
+
"basic functionality": {
|
|
9557
|
+
js: string;
|
|
9558
|
+
};
|
|
9559
|
+
};
|
|
9560
|
+
"property-type": string;
|
|
9561
|
+
};
|
|
9562
|
+
"raster-mask-import": {
|
|
9563
|
+
type: string;
|
|
9564
|
+
required: boolean;
|
|
9565
|
+
experimental: boolean;
|
|
9566
|
+
private: boolean;
|
|
9567
|
+
doc: string;
|
|
9568
|
+
example: string;
|
|
9569
|
+
transition: boolean;
|
|
9570
|
+
requires: string[];
|
|
9571
|
+
"sdk-support": {
|
|
9572
|
+
"basic functionality": {
|
|
9573
|
+
js: string;
|
|
9574
|
+
};
|
|
9575
|
+
};
|
|
9576
|
+
"property-type": string;
|
|
9577
|
+
};
|
|
9578
|
+
"raster-mask-mode": {
|
|
9579
|
+
type: string;
|
|
9580
|
+
doc: string;
|
|
9581
|
+
values: {
|
|
9582
|
+
"clip-path-intersect": {
|
|
9583
|
+
doc: string;
|
|
9584
|
+
};
|
|
9585
|
+
"clip-path-exclude": {
|
|
9586
|
+
doc: string;
|
|
9587
|
+
};
|
|
9588
|
+
};
|
|
9589
|
+
default: string;
|
|
9590
|
+
experimental: boolean;
|
|
9591
|
+
private: boolean;
|
|
9592
|
+
transition: boolean;
|
|
9593
|
+
requires: string[];
|
|
9594
|
+
"sdk-support": {
|
|
9595
|
+
"basic functionality": {
|
|
9596
|
+
js: string;
|
|
9597
|
+
};
|
|
9598
|
+
};
|
|
9599
|
+
"property-type": string;
|
|
9600
|
+
};
|
|
9547
9601
|
};
|
|
9548
9602
|
"paint_raster-particle": {
|
|
9549
9603
|
"raster-particle-array-band": {
|
|
@@ -11829,6 +11883,18 @@ type RasterLayerSpecification = {
|
|
|
11829
11883
|
* @experimental This property is experimental and subject to change in future versions.
|
|
11830
11884
|
*/
|
|
11831
11885
|
"raster-elevation-reference"?: "sea" | "ground" | ExpressionSpecification;
|
|
11886
|
+
/**
|
|
11887
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
11888
|
+
*/
|
|
11889
|
+
"raster-mask"?: string;
|
|
11890
|
+
/**
|
|
11891
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
11892
|
+
*/
|
|
11893
|
+
"raster-mask-import"?: string;
|
|
11894
|
+
/**
|
|
11895
|
+
* @experimental This property is experimental and subject to change in future versions.
|
|
11896
|
+
*/
|
|
11897
|
+
"raster-mask-mode"?: "clip-path-intersect" | "clip-path-exclude";
|
|
11832
11898
|
};
|
|
11833
11899
|
"appearances"?: Array<AppearanceSpecification>;
|
|
11834
11900
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -9997,6 +9997,64 @@ var paint_raster = {
|
|
|
9997
9997
|
interpolated: false
|
|
9998
9998
|
},
|
|
9999
9999
|
"property-type": "data-constant"
|
|
10000
|
+
},
|
|
10001
|
+
"raster-mask": {
|
|
10002
|
+
type: "string",
|
|
10003
|
+
required: false,
|
|
10004
|
+
experimental: true,
|
|
10005
|
+
"private": true,
|
|
10006
|
+
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.",
|
|
10007
|
+
example: "water",
|
|
10008
|
+
transition: false,
|
|
10009
|
+
"sdk-support": {
|
|
10010
|
+
"basic functionality": {
|
|
10011
|
+
js: "3.34.0"
|
|
10012
|
+
}
|
|
10013
|
+
},
|
|
10014
|
+
"property-type": "data-constant"
|
|
10015
|
+
},
|
|
10016
|
+
"raster-mask-import": {
|
|
10017
|
+
type: "string",
|
|
10018
|
+
required: false,
|
|
10019
|
+
experimental: true,
|
|
10020
|
+
"private": true,
|
|
10021
|
+
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.",
|
|
10022
|
+
example: "basemap",
|
|
10023
|
+
transition: false,
|
|
10024
|
+
requires: [
|
|
10025
|
+
"raster-mask"
|
|
10026
|
+
],
|
|
10027
|
+
"sdk-support": {
|
|
10028
|
+
"basic functionality": {
|
|
10029
|
+
js: "3.34.0"
|
|
10030
|
+
}
|
|
10031
|
+
},
|
|
10032
|
+
"property-type": "data-constant"
|
|
10033
|
+
},
|
|
10034
|
+
"raster-mask-mode": {
|
|
10035
|
+
type: "enum",
|
|
10036
|
+
doc: "Whether this layer is drawn inside or outside the mask.",
|
|
10037
|
+
values: {
|
|
10038
|
+
"clip-path-intersect": {
|
|
10039
|
+
doc: "Draw only where the mask layer's geometry covers the map."
|
|
10040
|
+
},
|
|
10041
|
+
"clip-path-exclude": {
|
|
10042
|
+
doc: "Draw only where the mask layer's geometry does not cover the map."
|
|
10043
|
+
}
|
|
10044
|
+
},
|
|
10045
|
+
"default": "clip-path-intersect",
|
|
10046
|
+
experimental: true,
|
|
10047
|
+
"private": true,
|
|
10048
|
+
transition: false,
|
|
10049
|
+
requires: [
|
|
10050
|
+
"raster-mask"
|
|
10051
|
+
],
|
|
10052
|
+
"sdk-support": {
|
|
10053
|
+
"basic functionality": {
|
|
10054
|
+
js: "3.34.0"
|
|
10055
|
+
}
|
|
10056
|
+
},
|
|
10057
|
+
"property-type": "data-constant"
|
|
10000
10058
|
}
|
|
10001
10059
|
};
|
|
10002
10060
|
var paint_hillshade = {
|
|
@@ -20433,6 +20491,25 @@ function validateLayer(options) {
|
|
|
20433
20491
|
}
|
|
20434
20492
|
}
|
|
20435
20493
|
}
|
|
20494
|
+
if (type === "raster" && isObject(layer.paint)) {
|
|
20495
|
+
const paint = layer.paint;
|
|
20496
|
+
const maskId = unbundle(paint["raster-mask"]);
|
|
20497
|
+
const importId = unbundle(paint["raster-mask-import"]);
|
|
20498
|
+
if (isString(maskId) && maskId) {
|
|
20499
|
+
if (isString(importId) && importId) {
|
|
20500
|
+
if (!(style.imports || []).some((i) => unbundle(i.id) === importId)) {
|
|
20501
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask-import`, paint["raster-mask-import"], `import "${importId}" not found`));
|
|
20502
|
+
}
|
|
20503
|
+
} else {
|
|
20504
|
+
const maskLayer = (style.layers || []).find((l) => unbundle(l.id) === maskId);
|
|
20505
|
+
if (!maskLayer) {
|
|
20506
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask`, paint["raster-mask"], `layer "${maskId}" not found`));
|
|
20507
|
+
} else if (unbundle(maskLayer.type) !== "fill") {
|
|
20508
|
+
errors.push(new ValidationError(`${key}.paint.raster-mask`, paint["raster-mask"], `layer "${maskId}" must be a "fill" layer`));
|
|
20509
|
+
}
|
|
20510
|
+
}
|
|
20511
|
+
}
|
|
20512
|
+
}
|
|
20436
20513
|
errors = errors.concat(validateObject({
|
|
20437
20514
|
key,
|
|
20438
20515
|
value: layer,
|