Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Leaflet

Lightweight JavaScript library for creating mobile-friendly interactive maps.

3D and graphicsNPM

GitHubWebsite

1. License

License from npm.

github.com/Leaflet/Leaflet

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Leaflet does

Leaflet's site says it "doesn't try to do everything for everyone" and instead focuses on "making the basic things work perfectly". The project currently sits between a v1.9.4 release from 2023 and a 2.0 alpha that the website already leads with.

Leaflet popularity

76 / 100
Gid Score, #176 overall
11.9M
downloads a week, npm
46K
GitHub stars
95
agent projects use it
Leaflet: downloads per weeknpm, leaflet 11,894,459
Leaflet: GitHub starsLeaflet/Leaflet 45,978

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Leaflet is used

  • Leaflet is a dependency in 95 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.0% of the 4,867 JavaScript/TypeScript ones), #2 of 63 in 3d and graphics.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 250; those are left out of every share on this page.
  • The most used alternative in our scan is Mapbox GL (24 projects).
  • Projects that use it most often also use React Leaflet (61.1%), Tailwind CSS (89.5%), Lucide React (67.4%).

By coding agent

51 projects, 1.6%
46 projects, 1.5%
45 projects, 1.8%
9 projects, 1.9%
7 projects, 1.5%
7 projects, 2.0%
6 projects, 2.2%

Often used with

In 61.1% of its projects
In 89.5% of its projects
In 67.4% of its projects
In 64.2% of its projects
In 58.9% of its projects
In 64.2% of its projects
In 47.4% of its projects
In 46.3% of its projects

Leaflet in practice

Strengths

No external dependencies

Under "Misc", the website's feature list says Leaflet is "Extremely lightweight" and has "No external dependencies".

Common layer types come built in

The site lists several layer types "out of the box": tile layers, WMS, markers, popups, polylines, polygons, circles, rectangles, image overlays and GeoJSON.

Inertia panning, shift-drag zoom, marker dragging

The site lists these interaction features: drag panning with inertia, scroll-wheel zoom, pinch-zoom on mobile, double-click zoom, shift-drag zoom to area, keyboard navigation, click and pointer events, and marker dragging.

Vector clipping and a modular build

The site says polyline and polygon rendering uses "dynamic clipping and simplification", which it says "makes it very fast". It also lists a modular build for leaving out unused features, and tap delay elimination on mobile.

Watch out for

Latest GitHub release dates from May 2023

The latest GitHub release is v1.9.4, published 2023-05-18. It was a bug-fix release, with fixes such as tile gaps in Chromium-based browsers.

Homepage opens on a 2.0 alpha

The website's first line says Leaflet 2.0.0-alpha.1 "has been released" and gives the date August 16, 2025. None of the sources here give release notes for the alpha, so what changed from 1.9.4 is not stated.

Missing features: plugins first, then issues

If a feature is missing, the site's advice is to check for a plugin and search past GitHub issues first. Only after that should you open a new GitHub issue.

Homepage example: OpenStreetMap tiles and a marker with a popup

import {LeafletMap, TileLayer, Marker} from 'leaflet';

const map = new LeafletMap('map').setView([51.505, -0.09], 13);

new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

new Marker([51.5, -0.09]).addTo(map)
    .bindPopup('A pretty CSS popup.<br> Easily customizable.')
    .openPopup();

More about Leaflet

Funding
  • GitHub Sponsors: https://github.com/Leaflet
  • Open Collective: https://opencollective.com/leafletjs
  • 19 GitHub sponsors

See all

Packages around it
  • react-leaflet: React bindings for Leaflet
  • lucide-react: Icon components
  • tailwindcss: Utility-first CSS
  • tailwind-merge: Tailwind class merging
  • clsx: Class name joining
  • class-variance-authority: Component style variants
More in 3D and graphics

Alternatives

Leaflet This page

BSD-2-ClauseGid 7611.9M/wk

Mapbox GL

WebGL-based interactive maps library for rendering vector tiles and geospatial data.

SEE LICENSE IN LICENSE.txtGid 646.4M/wk

MapLibre GL

Open-source WebGL interactive maps library with BSD license and community support.

BSD-3-ClauseGid 6611.4M/wk

Compare Leaflet with another tool

Get started

Install it.

npm install leaflet

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Leaflet
- Create the map in an existing container element (the docs use a `'map'` div), then call `setView` with a center and a zoom level.
- These layers come with core "out of the box": tile layers, WMS, markers, popups, polylines, polygons, circles, rectangles, image overlays and GeoJSON.
- Restyle popups and controls through CSS, which the docs describe as "Pure CSS popups and controls for easy restyling".
- For custom behaviour, use the docs' "simple interface for custom map layers and controls", or extend existing classes with the OOP facilities the docs list.
- If a feature is missing from core, look for an existing plugin and search GitHub issues before opening a new issue.