I have a geoJson layer showing U.S. states, with only an ID, and no other properties.
I also have a local array of data in memory with lots of properties about those states: things like population, acres of farmland, sales tax rate etc. One of the properties is the ID that's in the geoJson layer. So I should be able to join the local array with features in the geoJson layer.
I would like to be able to thematically style the states based on any of those properties, allowing the user the ability to choose the property. All the examples I have seen for thematic styling of GeoJson layers in MapBox require (1) that the properties exist in the geoJson itself, and (2) that you define the property and styling rules in advance (I'm not sure if there's a way to change this at a later point).
In other map libraries, I think including Leaflet, you can define a paint function, and pass in the feature. Is there anything like this in MapBox GL?
Thanks.