Skip to content

Dynamically updating LineLayer paint properties #119

Answered by wx007
wx007 asked this question in Q&A
Discussion options

You must be logged in to vote

Finally figured it out. After revisiting the setPaintProperty method I'm able to change the outline color on the map using the format:

myMap.setPaintProperty('layerId', 'paintPropertyName', newColorValue] )

Just be sure the map instance exists first.
And no need to bind the data object to the paint property in LineLayer. Just use paint={myPaintPropertyObject}
Thanks dabreegster for you suggestions that helped find the answer.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dimfeld
Comment options

Answer selected by wx007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants