leaflet
Leaflet — Lightweight Open-Source Maps
Overview
Leaflet is a lightweight open-source JavaScript library for interactive maps: raster tile layers, markers, popups, vector shapes, GeoJSON and map events, with clustering and other features added by plugins. It has no API key of its own — the tiles come from a provider you choose, such as OpenStreetMap. In React it is used through react-leaflet, which wraps the same Leaflet objects in components.
The stable release is 1.9.4 (May 2023) and it is what npm install leaflet installs. Leaflet 2.0 is still an alpha (2.0.0-alpha.1, August 2025): it is ESM-only and drops the global L and the factory functions (L.marker(latlng) becomes new Marker(latlng)), while react-leaflet 5 and plugins written for the global L still require 1.9. Use 1.9.4 unless the user asks for 2.0.
Instructions
Installation
npm install leaflet
npm install -D @types/leaflet # TypeScript types (Leaflet 1.9 ships none)
# React 19
npm install react-leaflet react-leaflet-cluster # react-leaflet 5, cluster 4