Create a choropleth map
This is a modified version of the Basic template style.
state-datahas been added.
The source data for the
state-datalayer comes from a custom tileset that has been uploaded to Mapbox Studio.
States are styled using property expressions to style features across a data range.
- Tileset from custom data: The data that is used as the
state-datalayer comes from a custom tileset that was created by uploading a GeoJSON file to Mapbox Studio. This data is borrowed from the Leaflet choropleth tutorial and contains data on population density across US states. The tileset itself contains the geometry for each state and two properties:
name(a string) and
density(a number). Read more about uploading data to Mapbox Studio in the Overview section.
- Styling with expressions: The
state-datalayer is styled using property expressions. In this case, property expressions are being used on the Color property to style features across a data range. The color of each feature will be determined based on its
Looking for more guidance? Read our Make a choropleth map, part 1: create a style tutorial.