Skip to main content

Create a choropleth map

  • This is a modified version of the Streets template style.

  • A new fill layer called state-data has been added.

  • The source data for the state-data layer 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.

About this style

  • Tileset from custom data: The data that is used as the source for the state-data layer 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.
  • Layers tab: This example uses a custom layer added and styled in the Layers tab.
  • Styling with expressions: The state-data layer is styled using property expressions. In this case, property expressions are being used on the Color property to style a fill layer across the data range. The color of each feature will be determined based on its density.

Looking for more guidance? Read our Make a choropleth map, part 1: create a style tutorial.

Was this example helpful?