nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

How is it possible to use dynamic-styles #1503

Closed soleimani21 closed 5 years ago

soleimani21 commented 5 years ago

How is it possible to use dynamic-styles to set individual fill colors for each polygon within the same layer or FeatureCollection? Currently, I'm passing one FeatureCollection object to MapboxGL.ShapeSource, and I do not know how to access the "loop" and set individual style from a feature property. How can I do this?

nitaliano commented 5 years ago

Check this example out https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/src/components/DataDrivenCircleColors.js