-
-
Notifications
You must be signed in to change notification settings - Fork 926
Added support for setStyleLayerProperty #4051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 |

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)