Skip to content

Commit 432d534

Browse files
authored
Update style-spec to Mapbox Maps SDK 11.23.1 (#4207)
Bump iOS/Android SDK references to 11.23.1 and update v8.json style spec. Newly supported properties: fillExtrusionCastShadows, iconColorContrast, iconColorBrightnessMin, iconColorBrightnessMax, hillshadeEmissiveStrength, and line-progress support for lineEmissiveStrength.
1 parent 32ee76b commit 432d534

12 files changed

Lines changed: 638 additions & 19 deletions

File tree

android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleFactory.kt

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ object RNMBXStyleFactory {
413413
setTextOcclusionOpacityTransition(layer, styleValue)
414414
"iconColorSaturation" ->
415415
setIconColorSaturation(layer, styleValue)
416+
"iconColorContrast" ->
417+
setIconColorContrast(layer, styleValue)
418+
"iconColorBrightnessMin" ->
419+
setIconColorBrightnessMin(layer, styleValue)
420+
"iconColorBrightnessMax" ->
421+
setIconColorBrightnessMax(layer, styleValue)
416422
"symbolZOffset" ->
417423
setSymbolZOffset(layer, styleValue)
418424
"symbolZOffsetTransition" ->
@@ -645,6 +651,8 @@ object RNMBXStyleFactory {
645651
setFillExtrusionLineWidth(layer, styleValue)
646652
"fillExtrusionLineWidthTransition" ->
647653
setFillExtrusionLineWidthTransition(layer, styleValue)
654+
"fillExtrusionCastShadows" ->
655+
setFillExtrusionCastShadows(layer, styleValue)
648656
}
649657
} catch (e: MapboxStyleException) {
650658
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
@@ -791,6 +799,10 @@ object RNMBXStyleFactory {
791799
setHillshadeAccentColor(layer, styleValue)
792800
"hillshadeAccentColorTransition" ->
793801
setHillshadeAccentColorTransition(layer, styleValue)
802+
"hillshadeEmissiveStrength" ->
803+
setHillshadeEmissiveStrength(layer, styleValue)
804+
"hillshadeEmissiveStrengthTransition" ->
805+
setHillshadeEmissiveStrengthTransition(layer, styleValue)
794806
}
795807
} catch (e: MapboxStyleException) {
796808
Logger.e(LOG_TAG, "Failed to update: $styleKey ${e.message}")
@@ -3195,6 +3207,60 @@ object RNMBXStyleFactory {
31953207
}
31963208
}
31973209

3210+
fun setIconColorContrast(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
3211+
if (styleValue.isExpression()) {
3212+
val expression = styleValue.getExpression()
3213+
if (expression != null) {
3214+
layer.iconColorContrast(expression)
3215+
} else {
3216+
Logger.e("RNMBXSymbol", "Expression for iconColorContrast is null")
3217+
}
3218+
} else {
3219+
val value = styleValue.getDouble(VALUE_KEY)
3220+
if (value != null) {
3221+
layer.iconColorContrast(value)
3222+
} else {
3223+
Logger.e("RNMBXSymbol", "value for iconColorContrast is null")
3224+
}
3225+
}
3226+
}
3227+
3228+
fun setIconColorBrightnessMin(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
3229+
if (styleValue.isExpression()) {
3230+
val expression = styleValue.getExpression()
3231+
if (expression != null) {
3232+
layer.iconColorBrightnessMin(expression)
3233+
} else {
3234+
Logger.e("RNMBXSymbol", "Expression for iconColorBrightnessMin is null")
3235+
}
3236+
} else {
3237+
val value = styleValue.getDouble(VALUE_KEY)
3238+
if (value != null) {
3239+
layer.iconColorBrightnessMin(value)
3240+
} else {
3241+
Logger.e("RNMBXSymbol", "value for iconColorBrightnessMin is null")
3242+
}
3243+
}
3244+
}
3245+
3246+
fun setIconColorBrightnessMax(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
3247+
if (styleValue.isExpression()) {
3248+
val expression = styleValue.getExpression()
3249+
if (expression != null) {
3250+
layer.iconColorBrightnessMax(expression)
3251+
} else {
3252+
Logger.e("RNMBXSymbol", "Expression for iconColorBrightnessMax is null")
3253+
}
3254+
} else {
3255+
val value = styleValue.getDouble(VALUE_KEY)
3256+
if (value != null) {
3257+
layer.iconColorBrightnessMax(value)
3258+
} else {
3259+
Logger.e("RNMBXSymbol", "value for iconColorBrightnessMax is null")
3260+
}
3261+
}
3262+
}
3263+
31983264
fun setSymbolZOffset(layer: SymbolLayer, styleValue: RNMBXStyleValue ) {
31993265
if (styleValue.isExpression()) {
32003266
val expression = styleValue.getExpression()
@@ -4270,6 +4336,24 @@ object RNMBXStyleFactory {
42704336
}
42714337
}
42724338

4339+
fun setFillExtrusionCastShadows(layer: FillExtrusionLayer, styleValue: RNMBXStyleValue ) {
4340+
if (styleValue.isExpression()) {
4341+
val expression = styleValue.getExpression()
4342+
if (expression != null) {
4343+
layer.fillExtrusionCastShadows(expression)
4344+
} else {
4345+
Logger.e("RNMBXFillExtrusion", "Expression for fillExtrusionCastShadows is null")
4346+
}
4347+
} else {
4348+
val value = styleValue.getBoolean(VALUE_KEY)
4349+
if (value != null) {
4350+
layer.fillExtrusionCastShadows(value)
4351+
} else {
4352+
Logger.e("RNMBXFillExtrusion", "value for fillExtrusionCastShadows is null")
4353+
}
4354+
}
4355+
}
4356+
42734357
fun setVisibility(layer: RasterLayer, styleValue: RNMBXStyleValue ) {
42744358
layer.visibility(Visibility.valueOf(styleValue.getEnumName()));
42754359
}
@@ -4881,6 +4965,32 @@ object RNMBXStyleFactory {
48814965
}
48824966
}
48834967

4968+
fun setHillshadeEmissiveStrength(layer: HillshadeLayer, styleValue: RNMBXStyleValue ) {
4969+
if (styleValue.isExpression()) {
4970+
val expression = styleValue.getExpression()
4971+
if (expression != null) {
4972+
layer.hillshadeEmissiveStrength(expression)
4973+
} else {
4974+
Logger.e("RNMBXHillshade", "Expression for hillshadeEmissiveStrength is null")
4975+
}
4976+
} else {
4977+
val value = styleValue.getDouble(VALUE_KEY)
4978+
if (value != null) {
4979+
layer.hillshadeEmissiveStrength(value)
4980+
} else {
4981+
Logger.e("RNMBXHillshade", "value for hillshadeEmissiveStrength is null")
4982+
}
4983+
}
4984+
}
4985+
4986+
4987+
fun setHillshadeEmissiveStrengthTransition(layer: HillshadeLayer, styleValue: RNMBXStyleValue) {
4988+
val transition = styleValue.transition
4989+
if (transition != null) {
4990+
layer.hillshadeEmissiveStrengthTransition(transition);
4991+
}
4992+
}
4993+
48844994
fun setModelAllowDensityReduction(layer: ModelLayer, styleValue: RNMBXStyleValue ) {
48854995
if (styleValue.isExpression()) {
48864996
val expression = styleValue.getExpression()

docs/FillExtrusionLayer.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Customizable style attributes
155155
* <a href="#fillextrusioncutofffaderange">fillExtrusionCutoffFadeRange</a><br/>
156156
* <a href="#fillextrusionemissivestrength">fillExtrusionEmissiveStrength</a><br/>
157157
* <a href="#fillextrusionlinewidth">fillExtrusionLineWidth</a><br/>
158+
* <a href="#fillextrusioncastshadows">fillExtrusionCastShadows</a><br/>
158159

159160
___
160161

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

12151216

1217+
___
1218+
1219+
### fillExtrusionCastShadows
1220+
Name: `fillExtrusionCastShadows`
1221+
1222+
Mapbox spec: [fill-extrusion-cast-shadows](https://docs.mapbox.com/style-spec/reference/layers/#paint-fill-extrusion-fill-extrusion-cast-shadows)
1223+
1224+
#### Description
1225+
Enable/Disable shadow casting for this layer
1226+
1227+
#### Type
1228+
`boolean`
1229+
#### Default Value
1230+
`true`
1231+
1232+
1233+

docs/HillshadeLayer.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Customizable style attributes
144144
* <a href="#hillshadeshadowcolor">hillshadeShadowColor</a><br/>
145145
* <a href="#hillshadehighlightcolor">hillshadeHighlightColor</a><br/>
146146
* <a href="#hillshadeaccentcolor">hillshadeAccentColor</a><br/>
147+
* <a href="#hillshadeemissivestrength">hillshadeEmissiveStrength</a><br/>
147148

148149
___
149150

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

383384

385+
___
386+
387+
### hillshadeEmissiveStrength
388+
Name: `hillshadeEmissiveStrength`
389+
390+
Mapbox spec: [hillshade-emissive-strength](https://docs.mapbox.com/style-spec/reference/layers/#paint-hillshade-hillshade-emissive-strength)
391+
392+
#### Description
393+
Controls the intensity of light emitted on the source features.
394+
395+
#### Type
396+
`number`
397+
#### Default Value
398+
`0`
399+
400+
#### Units
401+
`intensity`
402+
403+
#### Minimum
404+
`0`
405+
406+
407+
#### Requires
408+
`lights`
409+
410+
#### Expression
411+
412+
Parameters: `zoom, measure-light`
413+
___
414+
415+
### hillshadeEmissiveStrengthTransition
416+
Name: `hillshadeEmissiveStrengthTransition`
417+
418+
#### Description
419+
420+
The transition affecting any changes to this layer’s hillshadeEmissiveStrength property.
421+
422+
#### Type
423+
424+
`{ duration, delay }`
425+
426+
#### Units
427+
`milliseconds`
428+
429+
#### Default Value
430+
`{duration: 300, delay: 0}`
431+
432+

docs/LineLayer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ Controls the intensity of light emitted on the source features.
972972

973973
#### Expression
974974

975-
Parameters: `zoom, measure-light`
975+
Parameters: `zoom, measure-light, line-progress`
976976
___
977977

978978
### lineEmissiveStrengthTransition

docs/SymbolLayer.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ This is now deprecated, use Image component instead.
211211
* <a href="#texttranslate">textTranslate</a><br/>
212212
* <a href="#texttranslateanchor">textTranslateAnchor</a><br/>
213213
* <a href="#iconcolorsaturation">iconColorSaturation</a><br/>
214+
* <a href="#iconcolorcontrast">iconColorContrast</a><br/>
215+
* <a href="#iconcolorbrightnessmin">iconColorBrightnessMin</a><br/>
216+
* <a href="#iconcolorbrightnessmax">iconColorBrightnessMax</a><br/>
214217
* <a href="#symbolzoffset">symbolZOffset</a><br/>
215218

216219
___
@@ -2181,6 +2184,84 @@ Increase or reduce the saturation of the symbol icon.
21812184
`-1`
21822185

21832186

2187+
#### Maximum
2188+
`1`
2189+
2190+
#### Expression
2191+
2192+
Parameters: ``
2193+
2194+
___
2195+
2196+
### iconColorContrast
2197+
Name: `iconColorContrast`
2198+
2199+
Mapbox spec: [icon-color-contrast](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-contrast)
2200+
2201+
#### Description
2202+
Increase or reduce the contrast of the symbol icon.
2203+
2204+
#### Type
2205+
`number`
2206+
#### Default Value
2207+
`0`
2208+
2209+
#### Minimum
2210+
`-1`
2211+
2212+
2213+
#### Maximum
2214+
`1`
2215+
2216+
#### Expression
2217+
2218+
Parameters: ``
2219+
2220+
___
2221+
2222+
### iconColorBrightnessMin
2223+
Name: `iconColorBrightnessMin`
2224+
2225+
Mapbox spec: [icon-color-brightness-min](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-brightness-min)
2226+
2227+
#### Description
2228+
Increase or reduce the brightness of the symbols. The value is the minimum brightness.
2229+
2230+
#### Type
2231+
`number`
2232+
#### Default Value
2233+
`0`
2234+
2235+
#### Minimum
2236+
`0`
2237+
2238+
2239+
#### Maximum
2240+
`1`
2241+
2242+
#### Expression
2243+
2244+
Parameters: ``
2245+
2246+
___
2247+
2248+
### iconColorBrightnessMax
2249+
Name: `iconColorBrightnessMax`
2250+
2251+
Mapbox spec: [icon-color-brightness-max](https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color-brightness-max)
2252+
2253+
#### Description
2254+
Increase or reduce the brightness of the symbols. The value is the maximum brightness.
2255+
2256+
#### Type
2257+
`number`
2258+
#### Default Value
2259+
`1`
2260+
2261+
#### Minimum
2262+
`0`
2263+
2264+
21842265
#### Maximum
21852266
`1`
21862267

0 commit comments

Comments
 (0)