Skip to main content
100%

D3 + Leaflet (fork from bost.ocks.org/mike/leaflet/)

✓ Published0🌍 Public
ZZJONSSON
Last edited Jun 20, 2012
Created on Jun 20, 2012

This example combines D3 with Leaflet to create an interactive choropleth map of US states. The map uses Leaflet for tile-based map rendering and zooming, while D3 handles the geographic data. State boundaries are drawn as SVG paths using D3’s geo path generator, with a custom projection function that converts latitude and longitude coordinates to Leaflet layer points, ensuring the states align perfectly with the map tiles. The states are semi-transparent black, turning brown on hover. As users zoom or pan the map, the state boundaries are redrawn to match the new view, maintaining accurate overlay. The visualization demonstrates the integration of D3's data-driven SVG rendering with Leaflet's interactive map capabilities.

AI-generated description

Similar vizzes