Skip to main content
100%

Leaflet styling and interaction

✓ Published0🌍 Public
AAlan McConchie
Last edited Nov 4, 2016
Created on Nov 4, 2016

This example demonstrates interactive mouse behaviors on a world map using Leaflet. Hovering a country highlights it with a thicker border and increased fill opacity, while clicking zooms the map to fit that country’s bounds. The map uses Stamen Toner tiles and loads country polygons from a GeoJSON file. D3 fetches the data, and Leaflet’s `L.geoJson` renders the shapes, with `onEachFeature` attaching `mouseover`, `mouseout`, and `click` handlers to apply and reset styles.

AI-generated description

Basic mouse interactivity with Leaflet

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/enjalot/'>enjalot</a>'s block: <a href='http://bl.ocks.org/enjalot/a3342029863da04c6f70c679ba5edae4'>WWSD #2-b: Leaflet Choropleth</a>

mit Licensed

Similar vizzes