Mapbox Legend
✓ Published0🌍 Public
WWill Carter
Last edited Oct 23, 2019
Created on Oct 23, 2019
This example shows a choropleth map of US population density by state, with a hover tooltip displaying the density value. It uses the Mapbox GL JS library to render the interactive map and a custom HTML legend that maps population ranges to a sequential color scale. The legend is dynamically generated by iterating over hardcoded layer names and corresponding hex colors, and the map relies on a Mapbox Studio style for the underlying geographic data. The overlay panel and legend are styled with CSS, and no external data loading is shown beyond the style's built-in state boundaries.
AI-generated descriptionBuilt with blockbuilder.org
mit Licensed