web-maps-leaflet
Leaflet Interactive Map Patterns
Quick Guide: Use Leaflet (v1.9.4) for lightweight interactive maps.
L.mapfor initialization,L.tileLayerfor base maps,L.marker/L.popupfor points of interest,L.geoJSONfor vector data withonEachFeature/pointToLayer/style/filtercallbacks. Always include tile layer attribution. Always clean up maps withmap.remove()on teardown. UseL.markerClusterGroupfor 100+ markers. Use@types/leafletfor TypeScript support.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST call map.remove() when tearing down a map instance -- prevents memory leaks and orphaned event listeners)
(You MUST include attribution on tile layers -- most tile providers require it legally)
(You MUST use L.markerClusterGroup or canvas rendering for 100+ markers -- DOM markers do not scale)
(You MUST use named constants for coordinates, zoom levels, and style values -- NO magic numbers)