4

I'm searching the way to adjust the opacity of the mapbox map. In the following example, layers[0] refers to the background layer.

mapboxMap.style!!.layers[0]?.setProperties(rasterOpacity(0.3f))

Applying this code has no effect. What is wrong ?

wawanopoulos
  • 9,614
  • 31
  • 111
  • 166

1 Answers1

1
style.getLayer("layer_name").setProperties(
   rasterOpacity(0.3)
)
Vedant
  • 422
  • 1
  • 3
  • 21
  • 1
    While this code may provide a solution to problem, it is highly recommended that you provide additional context regarding why and/or how this code answers the question. Code only answers typically become useless in the long-run because future viewers experiencing similar problems cannot understand the reasoning behind the solution. – palaѕн May 14 '20 at 11:02