urbica / react-map-gl-draw

React Component for Mapbox GL Draw
https://urbica.github.io/react-map-gl-draw
MIT License
50 stars 11 forks source link

Mapbox GL Data Driven Styles Are not working as expected for me #21

Open KatherineGraham2019 opened 3 years ago

KatherineGraham2019 commented 3 years ago

Hey,

I am currently trying to use properties to set feature colors using the following syntax but having issues making styles work with properties.

styles={[{ 'type': 'fill', 'paint': { 'fill-color': ['get', "color"], 'fill-outline-color': "#008BCE", 'fill-opacity': 0.2 } }]}

This is my syntax, I set a color property on each feature. Any help and guidance on why this isn't working would be great. I was unable to find documentation on how to use mapbox gl's data drive styles with this react version.

Thanks