Black Lives Matter. Please consider donating to Black Girls Code today.

Choropleth custom regions and mapbox


I have a set of custom regions and the corresponding json as you present on the example on

Instead of setting the colors, in your example, two layers, each with one color; I would like the Choropleth, that is, shade the geographic regions by value.

I wonder how could I achieve that. Is there a way to set a value to the “redjson” object and have a color scale do the coloring?

I did a simplified version here to which I would like to have the color of the regions be set by set by some given z values.

Many thanks,


Not at the moment. We don’t support colorscales in mapbox layers.