From a06577b0d886ad702628a3a0aaee8a0bc48c737d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Sat, 21 Feb 2026 11:26:40 +0100 Subject: [PATCH] chore: upgrade Mapbox SDK to 11.18.2 and update style spec --- .../components/styles/RNMBXStyleFactory.kt | 35 +++ docs/BackgroundLayer.md | 2 +- docs/LineLayer.md | 9 +- docs/ModelLayer.md | 44 ++++ docs/RasterLayer.md | 2 +- docs/docs.json | 55 +++- ios/RNMBX/RNMBXStyle.swift | 24 +- package.json | 4 +- plugin/install.md | 6 +- src/utils/MapboxStyles.ts | 32 ++- src/utils/styleMap.ts | 2 + style-spec/v8.json | 243 +++++++++++++----- 12 files changed, 369 insertions(+), 89 deletions(-) diff --git a/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt b/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt index a8456b688..84694cb53 100644 --- a/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt +++ b/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt @@ -795,6 +795,8 @@ object RNMBXStyleFactory { val styleValue = style.getStyleValueForKey(styleKey) when (styleKey) { + "modelAllowDensityReduction" -> + setModelAllowDensityReduction(layer, styleValue) "visibility" -> setVisibility(layer, styleValue) "modelId" -> @@ -847,6 +849,8 @@ object RNMBXStyleFactory { setModelHeightBasedEmissiveStrengthMultiplierTransition(layer, styleValue) "modelCutoffFadeRange" -> setModelCutoffFadeRange(layer, styleValue) + "modelElevationReference" -> + setModelElevationReference(layer, styleValue) } } catch (e: MapboxStyleException) { Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}") @@ -4673,6 +4677,24 @@ object RNMBXStyleFactory { } } + fun setModelAllowDensityReduction(layer: ModelLayer, styleValue: RNMBXStyleValue ) { + if (styleValue.isExpression()) { + val expression = styleValue.getExpression() + if (expression != null) { + layer.modelAllowDensityReduction(expression) + } else { + Logger.e("RNMBXModel", "Expression for modelAllowDensityReduction is null") + } + } else { + val value = styleValue.getBoolean(VALUE_KEY) + if (value != null) { + layer.modelAllowDensityReduction(value) + } else { + Logger.e("RNMBXModel", "value for modelAllowDensityReduction is null") + } + } + } + fun setVisibility(layer: ModelLayer, styleValue: RNMBXStyleValue ) { layer.visibility(Visibility.valueOf(styleValue.getEnumName())); } @@ -5022,6 +5044,19 @@ object RNMBXStyleFactory { } } + fun setModelElevationReference(layer: ModelLayer, styleValue: RNMBXStyleValue ) { + if (styleValue.isExpression()) { + val expression = styleValue.getExpression() + if (expression != null) { + layer.modelElevationReference(expression) + } else { + Logger.e("RNMBXModel", "Expression for modelElevationReference is null") + } + } else { + layer.modelElevationReference(ModelElevationReference.valueOf(styleValue.getEnumName())) + } + } + fun setVisibility(layer: BackgroundLayer, styleValue: RNMBXStyleValue ) { layer.visibility(Visibility.valueOf(styleValue.getEnumName())); } diff --git a/docs/BackgroundLayer.md b/docs/BackgroundLayer.md index d8a61a290..ec652758e 100644 --- a/docs/BackgroundLayer.md +++ b/docs/BackgroundLayer.md @@ -201,7 +201,7 @@ The color with which the background will be drawn. #### Expression -Parameters: `zoom` +Parameters: `zoom, measure-light` ___ ### backgroundColorTransition diff --git a/docs/LineLayer.md b/docs/LineLayer.md index 690aa8ef9..0d2258ddb 100644 --- a/docs/LineLayer.md +++ b/docs/LineLayer.md @@ -282,14 +282,7 @@ Name: `lineZOffset` Mapbox spec: [line-z-offset](https://docs.mapbox.com/style-spec/reference/layers/#layout-line-line-z-offset) #### Description -Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues: - * Not supported for globe projection at the moment - * Elevated line discontinuity is possible on tile borders with terrain enabled - * Rendering artifacts can happen near line joins and line caps depending on the line styling - * Rendering artifacts relating to `lineOpacity` and `lineBlur` - * Elevated line visibility is determined by layer order - * ZFighting issues can happen with intersecting elevated lines - * Elevated lines don't cast shadows +Vertical offset from ground, in meters. Not supported for globe projection at the moment. #### Type `number` diff --git a/docs/ModelLayer.md b/docs/ModelLayer.md index ef4081ff7..47b32b12f 100644 --- a/docs/ModelLayer.md +++ b/docs/ModelLayer.md @@ -138,6 +138,7 @@ Customizable style attributes * visibility
* modelId
+* modelAllowDensityReduction
* modelOpacity
* modelRotation
* modelScale
@@ -152,6 +153,7 @@ Customizable style attributes * modelRoughness
* modelHeightBasedEmissiveStrengthMultiplier
* modelCutoffFadeRange
+* modelElevationReference
___ @@ -197,6 +199,23 @@ Model to render. It can be either a string referencing an element to the models Parameters: `zoom, feature` +___ + +### modelAllowDensityReduction +Name: `modelAllowDensityReduction` + +Mapbox spec: [model-allow-density-reduction](https://docs.mapbox.com/style-spec/reference/layers/#layout-model-model-allow-density-reduction) + +#### Description +If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render. + +#### Type +`boolean` +#### Default Value +`true` + + + ___ ### modelOpacity @@ -704,3 +723,28 @@ This parameter defines the range for the fadeOut effect before an automatic cont Parameters: `` +___ + +### modelElevationReference +Name: `modelElevationReference` + +Mapbox spec: [model-elevation-reference](https://docs.mapbox.com/style-spec/reference/layers/#paint-model-model-elevation-reference) + +#### Description +Selects the base of the model. Some modes might require precomputed elevation data in the tileset. When using vector tiled source as the model layer source and hdRoadMarkup elevation reference, this property acts as layout property and elevation is evaluated only in tile loading time. + +#### Type +`enum` +#### Default Value +`ground` + +#### Supported Values +**sea** - Elevated rendering is enabled. Use this mode to elevate models relative to the sea level.
+**ground** - Elevated rendering is enabled. Use this mode to elevate models relative to the ground's height below them.
+**hd-road-markup** - Elevated rendering is enabled. Use this mode to describe additive and stackable features that should exist only on top of road polygons.
+ + +#### Expression + +Parameters: `` + diff --git a/docs/RasterLayer.md b/docs/RasterLayer.md index 49d639007..642cd149d 100644 --- a/docs/RasterLayer.md +++ b/docs/RasterLayer.md @@ -665,7 +665,7 @@ Name: `rasterElevation` Mapbox spec: [raster-elevation](https://docs.mapbox.com/style-spec/reference/layers/#paint-raster-raster-elevation) #### Description -Specifies an uniform elevation from the ground, in meters. +Defines an uniform elevation from the base specified in rasterElevationReference, in meters. #### Type `number` diff --git a/docs/docs.json b/docs/docs.json index 56060783a..d10948f88 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -514,7 +514,8 @@ "expression": { "interpolated": true, "parameters": [ - "zoom" + "zoom", + "measure-light" ] }, "transition": true, @@ -3842,7 +3843,7 @@ "type": "number", "values": [], "default": 0, - "description": "Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues:\n * Not supported for globe projection at the moment \n * Elevated line discontinuity is possible on tile borders with terrain enabled \n * Rendering artifacts can happen near line joins and line caps depending on the line styling \n * Rendering artifacts relating to `lineOpacity` and `lineBlur` \n * Elevated line visibility is determined by layer order \n * ZFighting issues can happen with intersecting elevated lines \n * Elevated lines don't cast shadows", + "description": "Vertical offset from ground, in meters. Not supported for globe projection at the moment.", "requires": [ "lineElevationReference" ], @@ -5822,6 +5823,22 @@ "namespace": "layout" } }, + { + "name": "modelAllowDensityReduction", + "type": "boolean", + "values": [], + "default": true, + "description": "If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render.", + "requires": [], + "disabledBy": [], + "allowedFunctionTypes": [], + "transition": false, + "mbx": { + "fullName": "layout-model-model-allow-density-reduction", + "name": "model-allow-density-reduction", + "namespace": "layout" + } + }, { "name": "modelOpacity", "type": "number", @@ -6166,6 +6183,38 @@ "name": "model-cutoff-fade-range", "namespace": "paint" } + }, + { + "name": "modelElevationReference", + "type": "enum", + "values": [ + { + "value": "sea", + "doc": "Elevated rendering is enabled. Use this mode to elevate models relative to the sea level." + }, + { + "value": "ground", + "doc": "Elevated rendering is enabled. Use this mode to elevate models relative to the ground's height below them." + }, + { + "value": "hd-road-markup", + "doc": "Elevated rendering is enabled. Use this mode to describe additive and stackable features that should exist only on top of road polygons." + } + ], + "default": "ground", + "description": "Selects the base of the model. Some modes might require precomputed elevation data in the tileset. When using vector tiled source as the model layer source and hdRoadMarkup elevation reference, this property acts as layout property and elevation is evaluated only in tile loading time.", + "requires": [], + "disabledBy": [], + "allowedFunctionTypes": [], + "expression": { + "interpolated": false + }, + "transition": false, + "mbx": { + "fullName": "paint-model-model-elevation-reference", + "name": "model-elevation-reference", + "namespace": "paint" + } } ] }, @@ -6931,7 +6980,7 @@ "values": [], "minimum": 0, "default": 0, - "description": "Specifies an uniform elevation from the ground, in meters.", + "description": "Defines an uniform elevation from the base specified in rasterElevationReference, in meters.", "requires": [], "disabledBy": [], "allowedFunctionTypes": [], diff --git a/ios/RNMBX/RNMBXStyle.swift b/ios/RNMBX/RNMBXStyle.swift index c29ad6fd3..140f5584a 100644 --- a/ios/RNMBX/RNMBXStyle.swift +++ b/ios/RNMBX/RNMBXStyle.swift @@ -798,7 +798,9 @@ func modelLayer(layer: inout ModelLayer, reactStyle:Dictionary, old let styleValue = RNMBXStyleValue.make(reactStyle[prop]) - if (prop == "visibility") { + if (prop == "modelAllowDensityReduction") { + self.setModelAllowDensityReduction(&layer, styleValue:styleValue); + } else if (prop == "visibility") { self.setModelStyleLayerVisibility(&layer, styleValue:styleValue); } else if (prop == "modelId") { self.setModelId(&layer, styleValue:styleValue); @@ -850,6 +852,8 @@ func modelLayer(layer: inout ModelLayer, reactStyle:Dictionary, old self.setModelHeightBasedEmissiveStrengthMultiplierTransition(&layer, styleValue:styleValue); } else if (prop == "modelCutoffFadeRange") { self.setModelCutoffFadeRange(&layer, styleValue:styleValue); + } else if (prop == "modelElevationReference") { + self.setModelElevationReference(&layer, styleValue:styleValue); } else { Logger.log(level:.error, message: "Unexpected property \(prop) for layer: model") } @@ -3057,6 +3061,15 @@ func setHillshadeAccentColorTransition(_ layer: inout HillshadeLayer, styleValue +func setModelAllowDensityReduction(_ layer: inout ModelLayer, styleValue: RNMBXStyleValue) +{ + + + layer.modelAllowDensityReduction = styleValue.mglStyleValueBoolean(); + + +} + func setModelStyleLayerVisibility(_ layer: inout ModelLayer, styleValue: RNMBXStyleValue) { layer.visibility = styleValue.isVisible(); @@ -3247,6 +3260,15 @@ func setModelCutoffFadeRange(_ layer: inout ModelLayer, styleValue: RNMBXStyleVa } +func setModelElevationReference(_ layer: inout ModelLayer, styleValue: RNMBXStyleValue) +{ + + + layer.modelElevationReference = styleValue.mglStyleValueEnum(); + + +} + func setBackgroundStyleLayerVisibility(_ layer: inout BackgroundLayer, styleValue: RNMBXStyleValue) diff --git a/package.json b/package.json index 055b31114..431ea442e 100644 --- a/package.json +++ b/package.json @@ -74,8 +74,8 @@ }, "homepage": "https://github.com/rnmapbox/maps#readme", "mapbox": { - "ios": "~> 11.16.2", - "android": "11.16.2" + "ios": "~> 11.18.2", + "android": "11.18.2" }, "publishConfig": { "registry": "https://registry.npmjs.org/", diff --git a/plugin/install.md b/plugin/install.md index 77764ca06..3aee82bce 100644 --- a/plugin/install.md +++ b/plugin/install.md @@ -20,7 +20,7 @@ After installing this package, add the [config plugin](https://docs.expo.io/guid [ "@rnmapbox/maps", { - "RNMapboxMapsVersion": "11.13.4" + "RNMapboxMapsVersion": "11.18.2" } ] ] @@ -58,7 +58,7 @@ It's possible to overwrite the native SDK version with `RNMapboxMapsVersion`: [ "@rnmapbox/maps", { - "RNMapboxMapsVersion": "11.16.0" + "RNMapboxMapsVersion": "11.18.2" } ] ] @@ -75,7 +75,7 @@ To use V11 just set the version to a 11 version, see [the ios guide](/ios/instal [ "@rnmapbox/maps", { - "RNMapboxMapsVersion": "11.13.4" + "RNMapboxMapsVersion": "11.18.2" } ] ] diff --git a/src/utils/MapboxStyles.ts b/src/utils/MapboxStyles.ts index 3bba720a7..d13e5ea26 100644 --- a/src/utils/MapboxStyles.ts +++ b/src/utils/MapboxStyles.ts @@ -466,6 +466,15 @@ enum ModelTypeEnum { LocationIndicator = 'location-indicator', } type ModelTypeEnumValues = 'common-3d' | 'location-indicator'; +enum ModelElevationReferenceEnum { + /** Elevated rendering is enabled. Use this mode to elevate models relative to the sea level. */ + Sea = 'sea', + /** Elevated rendering is enabled. Use this mode to elevate models relative to the ground's height below them. */ + Ground = 'ground', + /** Elevated rendering is enabled. Use this mode to describe additive and stackable features that should exist only on top of road polygons. */ + HdRoadMarkup = 'hd-road-markup', +} +type ModelElevationReferenceEnumValues = 'sea' | 'ground' | 'hd-road-markup'; enum BackgroundPitchAlignmentEnum { /** The background is aligned to the plane of the map. */ Map = 'map', @@ -721,14 +730,7 @@ export interface LineLayerStyleProps { */ lineTrimOffset?: number[]; /** - * Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues: - * Not supported for globe projection at the moment - * Elevated line discontinuity is possible on tile borders with terrain enabled - * Rendering artifacts can happen near line joins and line caps depending on the line styling - * Rendering artifacts relating to `lineOpacity` and `lineBlur` - * Elevated line visibility is determined by layer order - * ZFighting issues can happen with intersecting elevated lines - * Elevated lines don't cast shadows + * Vertical offset from ground, in meters. Not supported for globe projection at the moment. * * @requires lineElevationReference */ @@ -1905,7 +1907,7 @@ export interface RasterLayerStyleProps { */ rasterArrayBand?: string; /** - * Specifies an uniform elevation from the ground, in meters. + * Defines an uniform elevation from the base specified in rasterElevationReference, in meters. */ rasterElevation?: Value; @@ -2015,6 +2017,10 @@ export interface HillshadeLayerStyleProps { hillshadeAccentColorTransition?: Transition; } export interface ModelLayerStyleProps { + /** + * If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render. + */ + modelAllowDensityReduction?: boolean; /** * Whether this layer is displayed. */ @@ -2141,6 +2147,12 @@ export interface ModelLayerStyleProps { * This parameter defines the range for the fadeOut effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled. */ modelCutoffFadeRange?: Value; + /** + * Selects the base of the model. Some modes might require precomputed elevation data in the tileset. When using vector tiled source as the model layer source and hdRoadMarkup elevation reference, this property acts as layout property and elevation is evaluated only in tile loading time. + */ + modelElevationReference?: Value< + Enum + >; } export interface BackgroundLayerStyleProps { /** @@ -2152,7 +2164,7 @@ export interface BackgroundLayerStyleProps { * * @disabledBy backgroundPattern */ - backgroundColor?: Value; + backgroundColor?: Value; /** * The transition affecting any changes to this layer’s backgroundColor property. diff --git a/src/utils/styleMap.ts b/src/utils/styleMap.ts index 24f04f051..34f292d50 100644 --- a/src/utils/styleMap.ts +++ b/src/utils/styleMap.ts @@ -286,6 +286,7 @@ const styleMap = { hillshadeAccentColor: StyleTypes.Color, hillshadeAccentColorTransition: StyleTypes.Transition, + modelAllowDensityReduction: StyleTypes.Constant, modelId: StyleTypes.Constant, modelOpacity: StyleTypes.Constant, modelOpacityTransition: StyleTypes.Transition, @@ -311,6 +312,7 @@ const styleMap = { modelHeightBasedEmissiveStrengthMultiplier: StyleTypes.Constant, modelHeightBasedEmissiveStrengthMultiplierTransition: StyleTypes.Transition, modelCutoffFadeRange: StyleTypes.Constant, + modelElevationReference: StyleTypes.Enum, backgroundColor: StyleTypes.Color, backgroundColorTransition: StyleTypes.Transition, diff --git a/style-spec/v8.json b/style-spec/v8.json index 59bb995ec..2ae3173da 100644 --- a/style-spec/v8.json +++ b/style-spec/v8.json @@ -125,6 +125,7 @@ }, "indoor": { "type": "indoor", + "private": true, "experimental": true, "doc": "Controls the behaviour of indoor features." }, @@ -592,6 +593,19 @@ "ios": "11.0.0" } } + }, + "shadow-draw-before-layer": { + "type": "string", + "property-type": "data-constant", + "doc": "Specify a layer before which shadows are drawn on the ground. If not specified, shadows are drawn after the last 3D layer. This property does not affect shadows on terrain.", + "sdk-support": { + "basic functionality": { + "js": "3.18.0", + "android": "11.18.0", + "ios": "11.18.0" + } + }, + "experimental": true } }, "properties_light_ambient": { @@ -845,7 +859,6 @@ "length": 4, "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`." }, - "experimental": true, "doc": "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage." }, "scheme": { @@ -877,7 +890,7 @@ }, "promoteId": { "type": "promoteId", - "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id" + "doc": "A property to use as a feature id (for feature state). It can be a property name, or an expression to evaluate as the ID, or an object of the form `{: }`. The expression can only be feature dependent if it is used. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id" }, "volatile": { "type": "boolean", @@ -935,7 +948,6 @@ "length": 4, "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`." }, - "experimental": true, "doc": "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage." }, "minzoom": { @@ -1027,7 +1039,6 @@ "length": 4, "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`." }, - "experimental": true, "doc": "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage." }, "minzoom": { @@ -1120,7 +1131,6 @@ "length": 4, "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`." }, - "experimental": true, "doc": "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage." }, "minzoom": { @@ -1243,7 +1253,7 @@ }, "promoteId": { "type": "promoteId", - "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`." + "doc": "A property to use as a feature id (for feature state). Either a property name, an expression to evaluate as the ID, or an object of the form `{: }`. The expression can only be feature dependent if it is used." }, "dynamic": { "type": "boolean", @@ -1431,6 +1441,10 @@ }, "doc": "Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area." }, + "url": { + "type": "string", + "doc": "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided." + }, "maxzoom": { "type": "number", "default": 18, @@ -1527,7 +1541,6 @@ "android": "11.16.0", "ios": "11.16.0" }, - "experimental": true, "private": true }, "raster": { @@ -1563,7 +1576,6 @@ }, "model": { "doc": "A 3D model", - "experimental": true, "sdk-support": { "basic functionality": { "js": "3.0.0", @@ -1667,8 +1679,8 @@ "type": "array", "value": "appearance", "supported-layer-types": ["symbol"], - "private": true, - "doc": "Conditional styling applied to layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Can be used in appearances' are supported." + "experimental": true, + "doc": "Conditional styling applied to symbol layer features based on dynamic conditions. If multiple conditions are true, only the first matching appearance will be applied. Only properties marked with 'Works with appearances' are supported." } }, "appearance": { @@ -1676,7 +1688,7 @@ "type": "boolean", "doc": "A boolean expression that determines when this appearance should be applied.", "expression": { - "interpolated": false, + "interpolated": true, "parameters": [ "zoom", "pitch", @@ -1833,6 +1845,21 @@ "vector" ] }] + }, + "model-allow-density-reduction": { + "type": "boolean", + "default": true, + "transition": false, + "experimental": true, + "doc": "If true, the models will be reduced in density based on the zoom level. This is useful for large datasets that may be slow to render.", + "sdk-support": { + "basic functionality": { + "js": "0.10.0", + "android": "2.0.1", + "ios": "2.0.0" + } + }, + "property-type": "data-constant" } }, "layout_clip": { @@ -1877,6 +1904,30 @@ "interpolated": false }, "property-type": "data-constant" + }, + "visibility": { + "type": "enum", + "values": { + "visible": { + "doc": "The layer is shown." + }, + "none": { + "doc": "The layer is not shown." + } + }, + "default": "visible", + "doc": "Whether this layer is displayed.", + "sdk-support": { + "basic functionality": { + "js": "3.18.0", + "android": "11.18.0", + "ios": "11.18.0" + } + }, + "expression": { + "interpolated": false + }, + "property-type": "data-constant" } }, "layout_fill": { @@ -2171,6 +2222,7 @@ }, "default": "visible", "doc": "Whether this layer is displayed.", + "private": true, "sdk-support": { "basic functionality": { "js": "3.16.0", @@ -2187,7 +2239,6 @@ "type": "boolean", "default": false, "doc": "Whether to render facade details on the buildings.", - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -2215,7 +2266,7 @@ "maximum": 200, "default": 3, "doc": "Number of floors created when building-facade is enabled.", - "experimental": true, + "private": true, "property-type": "data-driven", "sdk-support": { "basic functionality": { @@ -2245,7 +2296,7 @@ "maximum": 20.0, "default": 3.1, "doc": "Width of a floor. Think of this as measure how wide each unit should be. This effectively determines the number of units per each floor. Note that this does not affect the ground level facades (i.e. number of windows).", - "experimental": true, + "private": true, "property-type": "data-driven", "sdk-support": { "basic functionality": { @@ -2277,7 +2328,7 @@ "maximum": 1.0, "default": [0.9, 0.9], "doc": "Given as fractions, specifies the percentage of unit area covered by windows when building-facade is enabled. Note that the area of a unit is ultimately determined by `building-facade-unit-width` and `building-facade-floors`.", - "experimental": true, + "private": true, "property-type": "data-driven", "sdk-support": { "basic functionality": { @@ -2328,7 +2379,6 @@ }, "default": "flat", "doc": "Roof type to use for the procedural buildings.", - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -2357,7 +2407,6 @@ "units": "meters", "doc": "The height of the procedural buildings.", "transition": true, - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -2386,7 +2435,6 @@ "requires": [ "building-height" ], - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -2408,7 +2456,7 @@ "building-flood-light-wall-radius": { "property-type": "data-driven", "type": "number", - "experimental": true, + "private": true, "units": "meters", "default": 0, "minimum": 0, @@ -2440,7 +2488,7 @@ "building-flood-light-ground-radius": { "property-type": "data-driven", "type": "number", - "experimental": true, + "private": true, "units": "meters", "default": 0, "doc": "The extent of the flood light effect on the ground beneath the buildings in meters.", @@ -2471,7 +2519,7 @@ "building-flip-roof-orientation": { "property-type": "data-driven", "type": "boolean", - "experimental": true, + "private": true, "units": "meters", "default": false, "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.", @@ -2653,8 +2701,7 @@ }, "line-z-offset": { "type": "number", - "experimental": true, - "doc": "Vertical offset from ground, in meters. Defaults to 0. This is an experimental property with some known issues:\n * Not supported for globe projection at the moment \n * Elevated line discontinuity is possible on tile borders with terrain enabled \n * Rendering artifacts can happen near line joins and line caps depending on the line styling \n * Rendering artifacts relating to `line-opacity` and `line-blur` \n * Elevated line visibility is determined by layer order \n * Z-fighting issues can happen with intersecting elevated lines \n * Elevated lines don't cast shadows", + "doc": "Vertical offset from ground, in meters. Not supported for globe projection at the moment.", "default": 0, "requires": [ "line-elevation-reference" @@ -2699,7 +2746,6 @@ } }, "default": "none", - "experimental": true, "transition": false, "sdk-support": { "basic functionality": { @@ -2790,6 +2836,38 @@ ] }, "property-type": "data-constant" + }, + "line-elevation-ground-scale": { + "type": "number", + "default": 0, + "minimum": 0, + "maximum": 1, + "doc": "Controls how much the elevation of lines with `line-elevation-reference` set to `sea` scales with terrain exaggeration. A value of 0 keeps the line at a fixed altitude above sea level. A value of 1 scales the elevation proportionally with terrain exaggeration.", + "sdk-support": { + "basic functionality": { + "js": "3.19.0", + "android": "11.19.0", + "ios": "11.19.0" + }, + "data-driven styling": { + "js": "3.19.0", + "android": "11.19.0", + "ios": "11.19.0" + } + }, + "expression": { + "interpolated": true, + "parameters": [ + "zoom", + "feature", + "line-progress" + ] + }, + "requires": [ + "line-z-offset" + ], + "transition": true, + "property-type": "data-driven" } }, "layout_symbol": { @@ -3141,7 +3219,6 @@ "minimum": [0.1, 0.1], "maximum": [10, 10], "experimental": true, - "private": true, "expression": { "interpolated": false }, @@ -3624,6 +3701,7 @@ "requires": [ "text-field" ], + "appearance": true, "sdk-support": { "basic functionality": { "js": "0.10.0", @@ -3657,7 +3735,6 @@ "minimum": [0.1, 0.1], "maximum": [10, 10], "experimental": true, - "private": true, "expression": { "interpolated": false }, @@ -4021,6 +4098,7 @@ "requires": [ "text-field" ], + "appearance": true, "sdk-support": { "basic functionality": { "js": "0.10.0", @@ -4152,6 +4230,7 @@ "!": "text-radial-offset" } ], + "appearance": true, "sdk-support": { "basic functionality": { "js": "0.10.0", @@ -5746,6 +5825,19 @@ } } }, + "is-active-floor": { + "doc": "Experimental. Returns `true` if the input floor id belongs to one of the active indoor floors, `false` otherwise. In case of array of strings, returns `true` if any of the input floor ids belongs to one of the active indoor floors, `false` otherwise. Only supported in filters.", + "group": "Indoor", + "experimental": true, + "private": true, + "sdk-support": { + "basic functionality": { + "js": "3.16.0", + "android": "11.16.0", + "ios": "11.16.0" + } + } + }, "random": { "doc": "Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.", "group": "Math", @@ -6574,26 +6666,31 @@ } } }, - "indoor": { - "floorplanFeaturesetId": { + "indoor_source": { + "sourceId": { "type": "string", - "doc": "An ID of a featureset to be used to query indoor floorplans.", + "doc": "Source ID of a source to be used to retrieve indoor data.", "experimental": true, + "private": true, "transition": false, - "property-type": "data-constant", - "expression": { - "interpolated": false - } + "property-type": "data-constant" }, - "buildingFeaturesetId": { - "type": "string", - "doc": "An ID of a featureset to be used to add interactivity for building selection.", + "sourceLayers": { + "type": "array", + "value": "string", + "doc": "An array of source layers to be used to retrieve indoor data.", "experimental": true, + "private": true, "transition": false, - "property-type": "data-constant", - "expression": { - "interpolated": false - } + "property-type": "data-constant" + } + }, + "indoor": { + "*": { + "type": "indoor_source", + "private": true, + "experimental": true, + "doc": "Specification of an indoor source - sourceId and sourceLayer required for vector source, for GeoJSON sourceLayers should be omitted." } }, "light": { @@ -7898,7 +7995,6 @@ "maximum": 1, "doc": "The opacity of the entire procedural buildings layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.", "transition": true, - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -7921,7 +8017,6 @@ "default": 0, "minimum": 0, "maximum": 1, - "experimental": true, "private": true, "expression": { "interpolated": false, @@ -7944,7 +8039,6 @@ "default": 0, "minimum": 0, "maximum": 1, - "experimental": true, "private": true, "expression": { "interpolated": true, @@ -7965,7 +8059,6 @@ "building-ambient-occlusion-ground-radius": { "property-type": "data-constant", "type": "number", - "experimental": true, "private": true, "default": 3.0, "minimum": 0, @@ -7988,7 +8081,6 @@ "building-ambient-occlusion-ground-attenuation": { "property-type": "data-constant", "type": "number", - "experimental": true, "private": true, "default": 0.69, "minimum": 0.0, @@ -8012,7 +8104,6 @@ "building-vertical-scale": { "property-type": "data-constant", "type": "number", - "experimental": true, "private": true, "default": 1.0, "minimum": 0.0, @@ -8037,7 +8128,6 @@ "default": true, "doc": "Enable/Disable shadow casting for this layer", "transition": false, - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -8052,7 +8142,6 @@ "type": "color", "default": "rgba(193, 154, 127, 1)", "doc": "Color buildings. This can be styled using different building parts (e.g. window, wall, roof).", - "experimental": true, "private": true, "use-theme": true, "transition": false, @@ -8085,7 +8174,6 @@ "maximum": 5, "units": "intensity", "doc": "Controls the intensity of light emitted on the source features. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors).", - "experimental": true, "private": true, "sdk-support": { "basic functionality": { @@ -8115,7 +8203,7 @@ "minimum": 0, "maximum": 1, "doc": "Given as a fraction specifies the likelihood for the facades to be emissive when building-facade is enabled. A value of 0.0 means the window will never be emissive, while a value of 1.0 means the window will always be emissive. This can be used to create variations on a building where some windows are lit and some are not.", - "experimental": true, + "private": true, "property-type": "data-constant", "sdk-support": { "basic functionality": { @@ -8134,6 +8222,7 @@ }, "building-cutoff-fade-range": { "type": "number", + "private": true, "default": 0.0, "minimum": 0.0, "maximum": 1.0, @@ -8154,7 +8243,7 @@ "building-flood-light-color": { "property-type": "data-constant", "type": "color", - "experimental": true, + "private": true, "default": "#ffffff", "doc": "The color of the flood light effect on the walls of the buildings.", "requires": [ @@ -8180,7 +8269,7 @@ "building-flood-light-intensity": { "property-type": "data-constant", "type": "number", - "experimental": true, + "private": true, "default": 0.0, "minimum": 0.0, "maximum": 1.0, @@ -8207,7 +8296,7 @@ "building-flood-light-ground-attenuation": { "property-type": "data-constant", "type": "number", - "experimental": true, + "private": true, "default": 0.69, "minimum": 0.0, "maximum": 1.0, @@ -8710,6 +8799,11 @@ "js": "3.0.0", "android": "11.0.0", "ios": "11.0.0" + }, + "data-driven styling": { + "js": "3.17.0", + "android": "11.17.0", + "ios": "11.17.0" } }, "expression": { @@ -8719,7 +8813,7 @@ "measure-light" ] }, - "property-type": "data-constant" + "property-type": "data-driven" }, "line-border-width": { "type": "number", @@ -10321,7 +10415,7 @@ }, "raster-elevation": { "type": "number", - "doc": "Specifies an uniform elevation from the ground, in meters.", + "doc": "Defines an uniform elevation from the base specified in raster-elevation-reference, in meters.", "default": 0, "minimum": 0, "transition": true, @@ -10340,6 +10434,32 @@ ] }, "property-type": "data-constant" + }, + "raster-elevation-reference": { + "type": "enum", + "doc": "Selects the base of raster-elevation.", + "values": { + "sea": { + "doc": "Use this mode to elevate raster layers relative to the sea level." + }, + "ground": { + "doc": "Use this mode to elevate raster layers relative to the ground's height below them." + } + }, + "default": "sea", + "transition": false, + "experimental": true, + "sdk-support": { + "basic functionality": { + "js": "3.19.0", + "android": "11.19.0", + "ios": "11.19.0" + } + }, + "expression": { + "interpolated": false + }, + "property-type": "data-constant" } }, "paint_raster-particle": { @@ -10471,7 +10591,7 @@ }, "raster-particle-elevation": { "type": "number", - "doc": "Specifies an uniform elevation from the ground, in meters.", + "doc": "Defines an uniform elevation from sea level, in meters.", "default": 0, "minimum": 0, "transition": true, @@ -10704,7 +10824,8 @@ "expression": { "interpolated": true, "parameters": [ - "zoom" + "zoom", + "measure-light" ] }, "property-type": "data-constant" @@ -11362,7 +11483,7 @@ }, "model-elevation-reference": { "type": "enum", - "doc": "Selects the base of the model. Some modes might require precomputed elevation data in the tileset.", + "doc": "Selects the base of the model. Some modes might require precomputed elevation data in the tileset. When using vector tiled source as the model layer source and hd-road-markup elevation reference, this property acts as layout property and elevation is evaluated only in tile loading time.", "values": { "sea": { "doc": "Elevated rendering is enabled. Use this mode to elevate models relative to the sea level." @@ -11380,9 +11501,11 @@ "interpolated": false }, "property-type": "data-constant", - "experimental": true, "sdk-support": { "basic functionality": { + "js": "3.17.0", + "android": "11.10.0", + "ios": "11.10.0" } } } @@ -11424,7 +11547,7 @@ "promoteId": { "*": { "type": "*", - "doc": "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state." + "doc": "A feature property name to use as the ID, or an expression to evaluate as the ID for feature state. The expression can only be feature dependent if it is used." } }, "$doc": {