@mapbox/mapbox-gl-style-spec 14.8.0-beta.1 → 14.8.0

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
@@ -218,7 +218,7 @@
218
218
  featuresets: {
219
219
  experimental: true,
220
220
  type: "featuresets",
221
- doc: "Defines sets of features for querying, interaction, and feature state manipulation.",
221
+ doc: "Defines sets of features for querying, interaction, and state management on the map, referencing individual layers or subsets of layers within the map's style.",
222
222
  example: {
223
223
  poi: {
224
224
  selectors: [
@@ -1585,6 +1585,35 @@
1585
1585
  interpolated: false
1586
1586
  },
1587
1587
  "property-type": "constant"
1588
+ },
1589
+ "fill-elevation-reference": {
1590
+ type: "enum",
1591
+ doc: "Selects the base of fill-elevation. Some modes might require precomputed elevation data in the tileset.",
1592
+ values: {
1593
+ none: {
1594
+ doc: "Elevated rendering is disabled."
1595
+ },
1596
+ "hd-road-base": {
1597
+ doc: "Elevate geometry relative to HD roads. Use this mode to describe base polygons of the road networks."
1598
+ },
1599
+ "hd-road-markup": {
1600
+ doc: "Elevated rendering is enabled. Use this mode to describe additive and stackable features such as 'hatched areas' that should exist only on top of road polygons."
1601
+ }
1602
+ },
1603
+ "default": "none",
1604
+ experimental: true,
1605
+ "private": true,
1606
+ transition: false,
1607
+ "sdk-support": {
1608
+ "basic functionality": {
1609
+ android: "11.9.0",
1610
+ ios: "11.9.0"
1611
+ }
1612
+ },
1613
+ expression: {
1614
+ interpolated: false
1615
+ },
1616
+ "property-type": "data-constant"
1588
1617
  }
1589
1618
  };
1590
1619
  var layout_circle = {
@@ -2101,6 +2130,36 @@
2101
2130
  },
2102
2131
  "property-type": "data-constant"
2103
2132
  },
2133
+ "symbol-elevation-reference": {
2134
+ type: "enum",
2135
+ doc: "Selects the base of symbol-elevation.",
2136
+ values: {
2137
+ sea: {
2138
+ doc: "Elevate symbols relative to the sea level."
2139
+ },
2140
+ ground: {
2141
+ doc: "Elevate symbols relative to the ground's height below them."
2142
+ },
2143
+ "hd-road-markup": {
2144
+ doc: "Use this mode to enable elevated behavior for features that are rendered on top of 3D road polygons. The feature is currently being developed."
2145
+ }
2146
+ },
2147
+ "default": "ground",
2148
+ experimental: true,
2149
+ "sdk-support": {
2150
+ "basic functionality": {
2151
+ android: "11.9.0",
2152
+ ios: "11.9.0"
2153
+ }
2154
+ },
2155
+ expression: {
2156
+ interpolated: false,
2157
+ parameters: [
2158
+ "zoom"
2159
+ ]
2160
+ },
2161
+ "property-type": "data-constant"
2162
+ },
2104
2163
  "icon-allow-overlap": {
2105
2164
  type: "boolean",
2106
2165
  "default": false,
@@ -3474,6 +3533,62 @@
3474
3533
  ]
3475
3534
  }
3476
3535
  };
3536
+ var filter_hillshade = {
3537
+ type: "boolean",
3538
+ doc: "Expression which determines whether or not to enable the hillshade layer. Hillshade layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
3539
+ "default": false,
3540
+ transition: false,
3541
+ "property-type": "data-driven",
3542
+ expression: {
3543
+ interpolated: false,
3544
+ parameters: [
3545
+ "zoom",
3546
+ "feature"
3547
+ ]
3548
+ }
3549
+ };
3550
+ var filter_raster = {
3551
+ type: "boolean",
3552
+ doc: "Expression which determines whether or not to enable the raster layer. Raster layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
3553
+ "default": false,
3554
+ transition: false,
3555
+ "property-type": "data-driven",
3556
+ expression: {
3557
+ interpolated: false,
3558
+ parameters: [
3559
+ "zoom",
3560
+ "feature"
3561
+ ]
3562
+ }
3563
+ };
3564
+ var filter_clip = {
3565
+ type: "boolean",
3566
+ doc: "Expression which determines whether or not to enable the clip layer. Clip layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
3567
+ "default": false,
3568
+ transition: false,
3569
+ "property-type": "data-driven",
3570
+ expression: {
3571
+ interpolated: false,
3572
+ parameters: [
3573
+ "zoom",
3574
+ "feature"
3575
+ ]
3576
+ }
3577
+ };
3578
+ var filter_model = {
3579
+ type: "boolean",
3580
+ doc: "Expression which determines whether or not to display a model. Model layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
3581
+ "default": false,
3582
+ transition: false,
3583
+ "property-type": "data-driven",
3584
+ expression: {
3585
+ interpolated: false,
3586
+ parameters: [
3587
+ "zoom",
3588
+ "feature"
3589
+ ]
3590
+ }
3591
+ };
3477
3592
  var filter_line = {
3478
3593
  type: "boolean",
3479
3594
  doc: "Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
@@ -4153,7 +4268,7 @@
4153
4268
  }
4154
4269
  },
4155
4270
  "line-progress": {
4156
- doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",
4271
+ doc: "Returns the progress along a gradient line. Can only be used in the `line-gradient` and `line-z-offset` properties.",
4157
4272
  group: "Feature data",
4158
4273
  "sdk-support": {
4159
4274
  "basic functionality": {
@@ -7552,34 +7667,6 @@
7552
7667
  ]
7553
7668
  },
7554
7669
  "property-type": "data-driven"
7555
- },
7556
- "symbol-elevation-reference": {
7557
- type: "enum",
7558
- doc: "Selects the base of symbol-elevation.",
7559
- values: {
7560
- sea: {
7561
- doc: "Elevate symbols relative to the sea level."
7562
- },
7563
- ground: {
7564
- doc: "Elevate symbols relative to the ground's height below them."
7565
- }
7566
- },
7567
- "default": "ground",
7568
- experimental: true,
7569
- "sdk-support": {
7570
- "basic functionality": {
7571
- js: "3.7.0",
7572
- android: "11.7.0",
7573
- ios: "11.7.0"
7574
- }
7575
- },
7576
- expression: {
7577
- interpolated: false,
7578
- parameters: [
7579
- "zoom"
7580
- ]
7581
- },
7582
- "property-type": "data-constant"
7583
7670
  }
7584
7671
  };
7585
7672
  var paint_raster = {
@@ -9068,6 +9155,24 @@
9068
9155
  filter: filter,
9069
9156
  filter_symbol: filter_symbol,
9070
9157
  filter_fill: filter_fill,
9158
+ filter_hillshade: filter_hillshade,
9159
+ filter_raster: filter_raster,
9160
+ "filter_raster-particle": {
9161
+ type: "boolean",
9162
+ doc: "Expression which determines whether or not to enable the raster particle layer. Raster particle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\"pitch\"]` and `[\"distance-from-center\"]` expressions to reference the current state of the view.",
9163
+ "default": false,
9164
+ transition: false,
9165
+ "property-type": "data-driven",
9166
+ expression: {
9167
+ interpolated: false,
9168
+ parameters: [
9169
+ "zoom",
9170
+ "feature"
9171
+ ]
9172
+ }
9173
+ },
9174
+ filter_clip: filter_clip,
9175
+ filter_model: filter_model,
9071
9176
  filter_line: filter_line,
9072
9177
  filter_circle: filter_circle,
9073
9178
  "filter_fill-extrusion": {
@@ -16522,6 +16627,9 @@
16522
16627
  function supportsZoomExpression(spec) {
16523
16628
  return expressionHasParameter(spec.expression, 'zoom');
16524
16629
  }
16630
+ function supportsLineProgressExpression(spec) {
16631
+ return expressionHasParameter(spec.expression, 'line-progress');
16632
+ }
16525
16633
  function supportsInterpolation(spec) {
16526
16634
  return !!spec.expression && spec.expression.interpolated;
16527
16635
  }
@@ -16733,6 +16841,7 @@
16733
16841
  this._evaluator = new EvaluationContext(scope, options);
16734
16842
  this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;
16735
16843
  this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;
16844
+ this.configDependencies = getConfigDependencies(expression);
16736
16845
  }
16737
16846
  evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection, featureTileCoord, featureDistanceData) {
16738
16847
  this._evaluator.globals = globals;
@@ -16846,6 +16955,10 @@
16846
16955
  if (!isLightConstant && !supportsLightExpression(propertySpec)) {
16847
16956
  return error([new ParsingError$1('', 'measure-light expression not supported')]);
16848
16957
  }
16958
+ const isLineProgressConstant = isGlobalPropertyConstant(parsed, ['line-progress']);
16959
+ if (!isLineProgressConstant && !supportsLineProgressExpression(propertySpec)) {
16960
+ return error([new ParsingError$1('', 'line-progress expression not supported')]);
16961
+ }
16849
16962
  const canRelaxZoomRestriction = propertySpec.expression && propertySpec.expression.relaxZoomRestriction;
16850
16963
  const zoomCurve = findZoomCurve(parsed);
16851
16964
  if (!zoomCurve && !isZoomConstant && !canRelaxZoomRestriction) {
@@ -16856,12 +16969,12 @@
16856
16969
  return error([new ParsingError$1('', '"interpolate" expressions cannot be used with this property')]);
16857
16970
  }
16858
16971
  if (!zoomCurve) {
16859
- return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16972
+ return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16860
16973
  new ZoomConstantExpression('constant', expression.value, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16861
16974
  new ZoomConstantExpression('source', expression.value, isLightConstant));
16862
16975
  }
16863
16976
  const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : void 0;
16864
- return success(isFeatureConstant$1 ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16977
+ return success(isFeatureConstant$1 && isLineProgressConstant ? // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16865
16978
  new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, isLightConstant) : // @ts-expect-error - TS2339 - Property 'value' does not exist on type 'unknown'.
16866
16979
  new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, isLightConstant));
16867
16980
  }
@@ -17334,13 +17447,16 @@ Filter Expression:
17334
17447
  ${ JSON.stringify(filterExp, null, 2) }
17335
17448
  `);
17336
17449
  }
17337
- const filterSpec = v8[`filter_${ layerType }`];
17338
- const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
17339
17450
  let filterFunc = null;
17340
- if (compiledStaticFilter.result === 'error') {
17341
- throw new Error(compiledStaticFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', '));
17342
- } else {
17343
- filterFunc = (globalProperties, feature, canonical) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);
17451
+ let filterSpec = null;
17452
+ if (layerType !== 'background' && layerType !== 'sky' && layerType !== 'slot') {
17453
+ filterSpec = v8[`filter_${ layerType }`];
17454
+ const compiledStaticFilter = createExpression(staticFilter, filterSpec, scope, options);
17455
+ if (compiledStaticFilter.result === 'error') {
17456
+ throw new Error(compiledStaticFilter.value.map(err => `${ err.key }: ${ err.message }`).join(', '));
17457
+ } else {
17458
+ filterFunc = (globalProperties, feature, canonical) => compiledStaticFilter.value.evaluate(globalProperties, feature, {}, canonical);
17459
+ }
17344
17460
  }
17345
17461
  let dynamicFilterFunc = null;
17346
17462
  let needFeature = null;