@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 CHANGED
@@ -10003,6 +10003,64 @@
10003
10003
  interpolated: false
10004
10004
  },
10005
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"
10006
10064
  }
10007
10065
  };
10008
10066
  var paint_hillshade = {
@@ -20439,6 +20497,25 @@ Use an identity property function instead: ${example}.`
20439
20497
  }
20440
20498
  }
20441
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
+ }
20442
20519
  errors = errors.concat(validateObject({
20443
20520
  key,
20444
20521
  value: layer,