Added support for setStyleLayerProperty#4051
Conversation
|
@msaqlain thanks much, can you also add some motivation?! How is this different from our existing solution: <FillLayer id="building" existing style={{ visibility }} />https://rnmapbox.github.io/docs/examples/Map/ShowAndHideLayer |
|
Yes sure @mfazekas When we are only loading map using styleURL that contains all the Layers & SourceLayers we dont have references to all the FillLayer, LineLayer or other shapes. To toggle SourceLayers (composite, satellite) we have this method Similarly if you want to toggle a specific layer we dont have any method available. To enable this my in my PR i am using |
I think we do have this: const [visibility, setVisbility] = useState('visible')
...
<FillLayer id="building" existing style={{ visibility }} />This will change a specific layer of( |
|
@mfazekas If we use this approach as you mentioned, then in my scenario, I have to render 300 layers using
So to achieve this without explicitly mentioning |
|
@mfazekas Any update on this? |
|
@msaqlain we'd need CI to pass |
…-style-layer-property

Added
setStyleLayerPropertysupport that allows setting the value of a property for a specific layer referencing the specifiedlayerIdChecklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)