id author title date pages extension mime words sentences flesch summary cache txt leafletjs-com-9596 Interactive Choropleth Map - Leaflet - a JavaScript library for interactive maps .html text/html 1004 124 75 This is a case study of creating a colorful interactive choropleth map of US States Population Density with the help of GeoJSON and some custom controls (that will hopefully convince all the remaining major news and government websites that do not use Leaflet yet to start doing so). Let's display our states data on a map with a custom Mapbox style for nice grayscale tiles that look perfect as a background for visualizations: Using the values we got from it, we create a function that returns a color based on population density: Next we define a styling function for our GeoJSON layer so that its fillColor depends on feature.properties.density property, also adjusting the appearance a bit and adding a nice touch with dashed stroke. The handy geojson.resetStyle method will reset the layer style to its default state (defined by our style function). info.onAdd = function (map) { info.update(layer.feature.properties); ./cache/leafletjs-com-9596.html ./txt/leafletjs-com-9596.txt