@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.d.ts CHANGED
@@ -2354,7 +2354,6 @@ declare const _exports: {
2354
2354
  minimum: number;
2355
2355
  units: string;
2356
2356
  doc: string;
2357
- transition: boolean;
2358
2357
  private: boolean;
2359
2358
  "sdk-support": {
2360
2359
  "basic functionality": {
@@ -2379,7 +2378,6 @@ declare const _exports: {
2379
2378
  minimum: number;
2380
2379
  units: string;
2381
2380
  doc: string;
2382
- transition: boolean;
2383
2381
  requires: string[];
2384
2382
  private: boolean;
2385
2383
  "sdk-support": {
@@ -2408,7 +2406,6 @@ declare const _exports: {
2408
2406
  minimum: number;
2409
2407
  doc: string;
2410
2408
  requires: string[];
2411
- transition: boolean;
2412
2409
  expression: {
2413
2410
  interpolated: boolean;
2414
2411
  parameters: string[];
@@ -2434,7 +2431,6 @@ declare const _exports: {
2434
2431
  default: number;
2435
2432
  doc: string;
2436
2433
  requires: string[];
2437
- transition: boolean;
2438
2434
  expression: {
2439
2435
  interpolated: boolean;
2440
2436
  parameters: string[];
@@ -2458,7 +2454,6 @@ declare const _exports: {
2458
2454
  private: boolean;
2459
2455
  default: boolean;
2460
2456
  doc: string;
2461
- transition: boolean;
2462
2457
  requires: string[];
2463
2458
  expression: {
2464
2459
  interpolated: boolean;
@@ -2764,7 +2759,6 @@ declare const _exports: {
2764
2759
  parameters: string[];
2765
2760
  };
2766
2761
  requires: string[];
2767
- transition: boolean;
2768
2762
  "property-type": string;
2769
2763
  };
2770
2764
  };
@@ -9550,6 +9544,60 @@ declare const _exports: {
9550
9544
  };
9551
9545
  "property-type": string;
9552
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
+ };
9553
9601
  };
9554
9602
  "paint_raster-particle": {
9555
9603
  "raster-particle-array-band": {
@@ -11303,7 +11351,6 @@ type LineLayerSpecification = {
11303
11351
  */
11304
11352
  "line-width-unit"?: PropertyValueSpecification<"pixels" | "meters">;
11305
11353
  "line-elevation-ground-scale"?: DataDrivenPropertyValueSpecification<number>;
11306
- "line-elevation-ground-scale-transition"?: TransitionSpecification;
11307
11354
  };
11308
11355
  "paint"?: {
11309
11356
  "line-opacity"?: DataDrivenPropertyValueSpecification<number>;
@@ -11737,15 +11784,10 @@ type BuildingLayerSpecification = {
11737
11784
  "building-facade-window"?: DataDrivenPropertyValueSpecification<[number, number]>;
11738
11785
  "building-roof-shape"?: DataDrivenPropertyValueSpecification<"flat" | "hipped" | "gabled" | "parapet" | "mansard" | "skillion" | "pyramidal">;
11739
11786
  "building-height"?: DataDrivenPropertyValueSpecification<number>;
11740
- "building-height-transition"?: TransitionSpecification;
11741
11787
  "building-base"?: DataDrivenPropertyValueSpecification<number>;
11742
- "building-base-transition"?: TransitionSpecification;
11743
11788
  "building-flood-light-wall-radius"?: DataDrivenPropertyValueSpecification<number>;
11744
- "building-flood-light-wall-radius-transition"?: TransitionSpecification;
11745
11789
  "building-flood-light-ground-radius"?: DataDrivenPropertyValueSpecification<number>;
11746
- "building-flood-light-ground-radius-transition"?: TransitionSpecification;
11747
11790
  "building-flip-roof-orientation"?: DataDrivenPropertyValueSpecification<boolean>;
11748
- "building-flip-roof-orientation-transition"?: TransitionSpecification;
11749
11791
  };
11750
11792
  "paint"?: {
11751
11793
  "building-opacity"?: PropertyValueSpecification<number>;
@@ -11841,6 +11883,18 @@ type RasterLayerSpecification = {
11841
11883
  * @experimental This property is experimental and subject to change in future versions.
11842
11884
  */
11843
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";
11844
11898
  };
11845
11899
  "appearances"?: Array<AppearanceSpecification>;
11846
11900
  };
@@ -12697,6 +12751,7 @@ declare class StyleExpression {
12697
12751
  } | null;
12698
12752
  configDependencies: Set<string>;
12699
12753
  isIndoorDependent: boolean;
12754
+ isImageDependent: boolean;
12700
12755
  constructor(expression: Expression, propertySpec?: StylePropertySpecification | null, scope?: string | null, options?: ConfigOptions | null, iconImageUseTheme?: string | null);
12701
12756
  evaluateWithoutErrorHandling(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[], formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData): any;
12702
12757
  evaluate(globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: ImageId[], formattedSection?: FormattedSection, featureTileCoord?: Point, featureDistanceData?: FeatureDistanceData, iconImageUseTheme?: string): any;
package/dist/index.es.js CHANGED
@@ -198,7 +198,7 @@ var $root = {
198
198
  },
199
199
  projection: {
200
200
  type: "projection",
201
- 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 not supported outside of Mercator.",
201
+ 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.",
202
202
  example: {
203
203
  name: "albers",
204
204
  center: [
@@ -2394,7 +2394,6 @@ var layout_building = {
2394
2394
  minimum: 0,
2395
2395
  units: "meters",
2396
2396
  doc: "The height of the procedural buildings.",
2397
- transition: true,
2398
2397
  "private": true,
2399
2398
  "sdk-support": {
2400
2399
  "basic functionality": {
@@ -2419,7 +2418,6 @@ var layout_building = {
2419
2418
  minimum: 0,
2420
2419
  units: "meters",
2421
2420
  doc: "The height with which to extrude the base of this layer. Must be less than or equal to `building-height`.",
2422
- transition: true,
2423
2421
  requires: [
2424
2422
  "building-height"
2425
2423
  ],
@@ -2452,7 +2450,6 @@ var layout_building = {
2452
2450
  requires: [
2453
2451
  "lights"
2454
2452
  ],
2455
- transition: true,
2456
2453
  expression: {
2457
2454
  interpolated: true,
2458
2455
  parameters: [
@@ -2483,7 +2480,6 @@ var layout_building = {
2483
2480
  requires: [
2484
2481
  "lights"
2485
2482
  ],
2486
- transition: true,
2487
2483
  expression: {
2488
2484
  interpolated: true,
2489
2485
  parameters: [
@@ -2510,7 +2506,6 @@ var layout_building = {
2510
2506
  "private": true,
2511
2507
  "default": false,
2512
2508
  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.",
2513
- transition: true,
2514
2509
  requires: [
2515
2510
  "building-roof-shape"
2516
2511
  ],
@@ -2854,7 +2849,6 @@ var layout_line = {
2854
2849
  requires: [
2855
2850
  "line-z-offset"
2856
2851
  ],
2857
- transition: true,
2858
2852
  "property-type": "data-driven"
2859
2853
  }
2860
2854
  };
@@ -10003,6 +9997,64 @@ var paint_raster = {
10003
9997
  interpolated: false
10004
9998
  },
10005
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"
10006
10058
  }
10007
10059
  };
10008
10060
  var paint_hillshade = {
@@ -15163,7 +15215,7 @@ class Config {
15163
15215
  serialize() {
15164
15216
  const res = ["config", this.key];
15165
15217
  if (this.scope) {
15166
- res.concat(this.scope);
15218
+ res.push(this.scope);
15167
15219
  }
15168
15220
  return res;
15169
15221
  }
@@ -17990,12 +18042,13 @@ function collect(e, deps) {
17990
18042
  return;
17991
18043
  }
17992
18044
  if (e instanceof CompoundExpression && e.name === "is-active-floor") deps.isIndoorDependent = true;
18045
+ if (e instanceof ImageExpression) deps.isImageDependent = true;
17993
18046
  e.eachChild((arg) => {
17994
18047
  collect(arg, deps);
17995
18048
  });
17996
18049
  }
17997
18050
  function getExpressionDependencies(e) {
17998
- const deps = { configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false };
18051
+ const deps = { configDependencies: NO_CONFIG_DEPENDENCIES, isIndoorDependent: false, isImageDependent: false };
17999
18052
  collect(e, deps);
18000
18053
  return deps;
18001
18054
  }
@@ -18220,6 +18273,7 @@ class StyleExpression {
18220
18273
  const dependencies = getExpressionDependencies(expression);
18221
18274
  this.configDependencies = dependencies.configDependencies;
18222
18275
  this.isIndoorDependent = dependencies.isIndoorDependent;
18276
+ this.isImageDependent = dependencies.isImageDependent;
18223
18277
  }
18224
18278
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
18225
18279
  const evaluator = this._evaluator;
@@ -20437,6 +20491,25 @@ function validateLayer(options) {
20437
20491
  }
20438
20492
  }
20439
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
+ }
20440
20513
  errors = errors.concat(validateObject({
20441
20514
  key,
20442
20515
  value: layer,