I am mapping polygon data that is tiled on the fly using geojson-vt and leaflet. It works great.
That said, I really need to be able to change the color of each polygon based on its category as stored in a data column (cat1, cat2, cat3, cat4). Right now I am able to define the color of the boarder (strokestyle) and fill (fillStyle), but only for the whole layer.
I have been able to create a fill color that is random using
ctx.fillStyle = 'hsl(' + 360 * Math.random() + ', 50%, 50%)';
How can I bring the category into the mix?
Is this possible, or do I have to utilize a different tiling solution if I want to display by category?