Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ object RNMBXStyleFactory {
setTextOcclusionOpacityTransition(layer, styleValue)
"iconColorSaturation" ->
setIconColorSaturation(layer, styleValue)
"iconColorContrast" ->
setIconColorContrast(layer, styleValue)
"iconColorBrightnessMin" ->
setIconColorBrightnessMin(layer, styleValue)
"iconColorBrightnessMax" ->
setIconColorBrightnessMax(layer, styleValue)
"symbolZOffset" ->
setSymbolZOffset(layer, styleValue)
"symbolZOffsetTransition" ->
Expand Down Expand Up @@ -645,6 +651,8 @@ object RNMBXStyleFactory {
setFillExtrusionLineWidth(layer, styleValue)
"fillExtrusionLineWidthTransition" ->
setFillExtrusionLineWidthTransition(layer, styleValue)
"fillExtrusionCastShadows" ->
setFillExtrusionCastShadows(layer, styleValue)
}
} catch (e: MapboxStyleException) {
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
Expand Down Expand Up @@ -791,6 +799,10 @@ object RNMBXStyleFactory {
setHillshadeAccentColor(layer, styleValue)
"hillshadeAccentColorTransition" ->
setHillshadeAccentColorTransition(layer, styleValue)
"hillshadeEmissiveStrength" ->
setHillshadeEmissiveStrength(layer, styleValue)
"hillshadeEmissiveStrengthTransition" ->
setHillshadeEmissiveStrengthTransition(layer, styleValue)
}
} catch (e: MapboxStyleException) {
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
Expand Down Expand Up @@ -3195,6 +3207,60 @@ object RNMBXStyleFactory {
}
}

fun setIconColorContrast(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
if (expression != null) {
layer.iconColorContrast(expression)
} else {
Logger.e("RNMBXSymbol", "Expression for iconColorContrast is null")
}
} else {
val value = styleValue.getDouble(VALUE_KEY)
if (value != null) {
layer.iconColorContrast(value)
} else {
Logger.e("RNMBXSymbol", "value for iconColorContrast is null")
}
}
}

fun setIconColorBrightnessMin(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
if (expression != null) {
layer.iconColorBrightnessMin(expression)
} else {
Logger.e("RNMBXSymbol", "Expression for iconColorBrightnessMin is null")
}
} else {
val value = styleValue.getDouble(VALUE_KEY)
if (value != null) {
layer.iconColorBrightnessMin(value)
} else {
Logger.e("RNMBXSymbol", "value for iconColorBrightnessMin is null")
}
}
}

fun setIconColorBrightnessMax(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
if (expression != null) {
layer.iconColorBrightnessMax(expression)
} else {
Logger.e("RNMBXSymbol", "Expression for iconColorBrightnessMax is null")
}
} else {
val value = styleValue.getDouble(VALUE_KEY)
if (value != null) {
layer.iconColorBrightnessMax(value)
} else {
Logger.e("RNMBXSymbol", "value for iconColorBrightnessMax is null")
}
}
}

fun setSymbolZOffset(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
Expand Down Expand Up @@ -4270,6 +4336,24 @@ object RNMBXStyleFactory {
}
}

fun setFillExtrusionCastShadows(layer: FillExtrusionLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
if (expression != null) {
layer.fillExtrusionCastShadows(expression)
} else {
Logger.e("RNMBXFillExtrusion", "Expression for fillExtrusionCastShadows is null")
}
} else {
val value = styleValue.getBoolean(VALUE_KEY)
if (value != null) {
layer.fillExtrusionCastShadows(value)
} else {
Logger.e("RNMBXFillExtrusion", "value for fillExtrusionCastShadows is null")
}
}
}

fun setVisibility(layer: RasterLayer, styleValue: RNMBXStyleValue ) {
layer.visibility(Visibility.valueOf(styleValue.getEnumName()));
}
Expand Down Expand Up @@ -4881,6 +4965,32 @@ object RNMBXStyleFactory {
}
}

fun setHillshadeEmissiveStrength(layer: HillshadeLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
if (expression != null) {
layer.hillshadeEmissiveStrength(expression)
} else {
Logger.e("RNMBXHillshade", "Expression for hillshadeEmissiveStrength is null")
}
} else {
val value = styleValue.getDouble(VALUE_KEY)
if (value != null) {
layer.hillshadeEmissiveStrength(value)
} else {
Logger.e("RNMBXHillshade", "value for hillshadeEmissiveStrength is null")
}
}
}


fun setHillshadeEmissiveStrengthTransition(layer: HillshadeLayer, styleValue: RNMBXStyleValue) {
val transition = styleValue.transition
if (transition != null) {
layer.hillshadeEmissiveStrengthTransition(transition);
}
}

fun setModelAllowDensityReduction(layer: ModelLayer, styleValue: RNMBXStyleValue ) {
if (styleValue.isExpression()) {
val expression = styleValue.getExpression()
Expand Down
18 changes: 18 additions & 0 deletions docs/FillExtrusionLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ Customizable style attributes
* <a href="#fillextrusioncutofffaderange">fillExtrusionCutoffFadeRange</a><br/>
* <a href="#fillextrusionemissivestrength">fillExtrusionEmissiveStrength</a><br/>
* <a href="#fillextrusionlinewidth">fillExtrusionLineWidth</a><br/>
* <a href="#fillextrusioncastshadows">fillExtrusionCastShadows</a><br/>

___

Expand Down Expand Up @@ -1213,3 +1214,20 @@ The transition affecting any changes to this layer’s fillExtrusionLineWidth pr
`{duration: 300, delay: 0}`


___

### fillExtrusionCastShadows
Name: `fillExtrusionCastShadows`

Mapbox spec: [fill-extrusion-cast-shadows](https://docs.mapbox.com/style-spec/reference/layers/#paint-fill-extrusion-fill-extrusion-cast-shadows)

#### Description
Enable/Disable shadow casting for this layer

#### Type
`boolean`
#### Default Value
`true`



49 changes: 49 additions & 0 deletions docs/HillshadeLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Customizable style attributes
* <a href="#hillshadeshadowcolor">hillshadeShadowColor</a><br/>
* <a href="#hillshadehighlightcolor">hillshadeHighlightColor</a><br/>
* <a href="#hillshadeaccentcolor">hillshadeAccentColor</a><br/>
* <a href="#hillshadeemissivestrength">hillshadeEmissiveStrength</a><br/>

___

Expand Down Expand Up @@ -381,3 +382,51 @@ The transition affecting any changes to this layer’s hillshadeAccentColor prop
`{duration: 300, delay: 0}`


___

### hillshadeEmissiveStrength
Name: `hillshadeEmissiveStrength`

Mapbox spec: [hillshade-emissive-strength](https://docs.mapbox.com/style-spec/reference/layers/#paint-hillshade-hillshade-emissive-strength)

#### Description
Controls the intensity of light emitted on the source features.

#### Type
`number`
#### Default Value
`0`

#### Units
`intensity`

#### Minimum
`0`


#### Requires
`lights`

#### Expression

Parameters: `zoom, measure-light`
___

### hillshadeEmissiveStrengthTransition
Name: `hillshadeEmissiveStrengthTransition`

#### Description

The transition affecting any changes to this layer’s hillshadeEmissiveStrength property.

#### Type

`{ duration, delay }`

#### Units
`milliseconds`

#### Default Value
`{duration: 300, delay: 0}`


2 changes: 1 addition & 1 deletion docs/LineLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ Controls the intensity of light emitted on the source features.

#### Expression

Parameters: `zoom, measure-light`
Parameters: `zoom, measure-light, line-progress`
___

### lineEmissiveStrengthTransition
Expand Down
81 changes: 81 additions & 0 deletions docs/SymbolLayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ This is now deprecated, use Image component instead.
* <a href="#texttranslate">textTranslate</a><br/>
* <a href="#texttranslateanchor">textTranslateAnchor</a><br/>
* <a href="#iconcolorsaturation">iconColorSaturation</a><br/>
* <a href="#iconcolorcontrast">iconColorContrast</a><br/>
* <a href="#iconcolorbrightnessmin">iconColorBrightnessMin</a><br/>
* <a href="#iconcolorbrightnessmax">iconColorBrightnessMax</a><br/>
* <a href="#symbolzoffset">symbolZOffset</a><br/>

___
Expand Down Expand Up @@ -2181,6 +2184,84 @@ Increase or reduce the saturation of the symbol icon.
`-1`


#### Maximum
`1`

#### Expression

Parameters: ``

___

### iconColorContrast
Name: `iconColorContrast`

Mapbox spec: [icon-color-contrast](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-contrast)

#### Description
Increase or reduce the contrast of the symbol icon.

#### Type
`number`
#### Default Value
`0`

#### Minimum
`-1`


#### Maximum
`1`

#### Expression

Parameters: ``

___

### iconColorBrightnessMin
Name: `iconColorBrightnessMin`

Mapbox spec: [icon-color-brightness-min](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-brightness-min)

#### Description
Increase or reduce the brightness of the symbols. The value is the minimum brightness.

#### Type
`number`
#### Default Value
`0`

#### Minimum
`0`


#### Maximum
`1`

#### Expression

Parameters: ``

___

### iconColorBrightnessMax
Name: `iconColorBrightnessMax`

Mapbox spec: [icon-color-brightness-max](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-brightness-max)

#### Description
Increase or reduce the brightness of the symbols. The value is the maximum brightness.

#### Type
`number`
#### Default Value
`1`

#### Minimum
`0`


#### Maximum
`1`

Expand Down
Loading
Loading