JavaScript maps libraries

Updated Nov 2026

JavaScript map libraries draw interactive maps in the browser from tiles, vector data, and map styles. A renderer either places raster tiles and DOM layers on a flat map or draws vector data on the GPU with WebGL. These libraries let apps show store locators, delivery routes, and geographic data on maps that users can pan and zoom.

Popularity

Leaflet has the most monthly downloads in this comparison, at 43.5M.

LibraryMonthly downloadsStarsLast releaseLicense
Leaflet
44.5M
46.0KMay 2023BSD-2-Clause
maplibre-gl
38.3M
12.1KNov 2026BSD-3-Clause
@googlemaps/js-api-loader
31.4M
452Sep 2026Apache-2.0
mapbox-gl
23.0M
12.5KNov 2026Mapbox TOS
deck.gl
5.5M
14.8KOct 2026MIT
OpenLayers
4.4M
12.7KOct 2026BSD-2-Clause
CesiumJS
1.7M
16.0KNov 2026Apache-2.0
ArcGIS Maps SDK for JavaScript
1.2M
Not on GitHubNov 2026Esri Master License Agreement
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Builds interactive maps with raster tiles, markers, geometry overlays, and popups.

Downloads / mo
44.5M
Stars
46.0K
Last release
1.9.4
License
BSD-2-Clause

Strengths

  • Adds raster tiles and markers. Combine tile layers, markers, and popups through a compact map API.
  • Draws interactive geometric overlays. Add circles and polygons with popups and map event handlers.

Limitations

  • Vector tiles need a plugin. Add VectorGrid when the map must display tiled vector data.
  • Marker clustering needs a plugin. Add MarkerCluster when dense point layers need grouped markers.

Quickstart

From example.md
$ npm install leaflet
import * as L from 'leaflet';
import 'leaflet/dist/leaflet.css';
const map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' }).addTo(map);

Leaflet examples

From open-source projects on GitHub

maplibre-gl

Renders interactive browser maps from vector tiles using WebGL and style documents.

Downloads / mo
38.3M
Stars
12.1K
Last release
6.19.0
License
BSD-3-Clause

Strengths

  • Styles vector tiles in-browser. Control the map appearance through a style document.
  • Supports custom WebGL layers. Draw into the map’s graphics context using its camera.

Limitations

  • Bundlers need worker URL setup. Configure the worker URL for the application’s bundler.
  • Hosted tiles need separate credentials. Get provider credentials when using MapTiler data.

Quickstart

From Map.md
$ npm install maplibre-gl
import { Map } from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
const map = new Map({ container: 'map', style: 'https://demotiles.maplibre.org/style.json', center: [0, 0], zoom: 2 });

@googlemaps/js-api-loader

Loads the Google Maps JavaScript API script in the browser.

Downloads / mo
31.4M
Stars
452
Last release
2.1.3
License
Apache-2.0

Quickstart

From README.md
$ npm install @googlemaps/js-api-loader
import { setOptions, importLibrary } from '@googlemaps/js-api-loader';
setOptions({ key: 'YOUR_API_KEY', v: 'weekly' });
const { Map } = await importLibrary('maps');
const map = new Map(document.getElementById('map'), { center: { lat: 0, lng: 0 }, zoom: 2 });

mapbox-gl

Renders interactive web maps with Mapbox styles, sources, and client-side vector rendering.

Downloads / mo
23.0M
Stars
12.5K
Last release
3.35.1
License
Mapbox TOS

Strengths

  • Styles vector tiles in-browser. Change map styles and displayed data in response to user interaction.
  • Clusters point sources natively. Group point features into clusters and style the resulting layers.

Limitations

  • Requires an account access token. Provide a valid access token from a Mapbox account.
  • PNG capture needs preserved buffers. Enable preserveDrawingBuffer before exporting the canvas to PNG.

Quickstart

From map.md
$ npm install mapbox-gl
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
mapboxgl.accessToken = 'YOUR_MAPBOX_ACCESS_TOKEN';
const map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/standard', center: [0, 0], zoom: 2 });

Provides the core of the deck.gl visualization framework.

Downloads / mo
5.5M
Stars
14.8K
Last release
9.4.1
License
MIT

Quickstart

From deck.md
$ npm install @deck.gl/core@9.4.1 @deck.gl/layers@9.4.1
import { Deck } from '@deck.gl/core';
import { ScatterplotLayer } from '@deck.gl/layers';
const deck = new Deck({
  parent: document.getElementById('map'),
  initialViewState: { longitude: -0.1, latitude: 51.5, zoom: 10 }, controller: true,
  layers: [new ScatterplotLayer({ id: 'point', data: [[-0.1, 51.5]], getPosition: d => d, getRadius: 1000, getFillColor: [255, 0, 0] })]
});

deck.gl examples

From open-source projects on GitHub

OpenLayers

Displays raster and vector geospatial data with configurable map projections.

Downloads / mo
4.4M
Stars
12.7K
Last release
10.11.0
License
BSD-2-Clause

Strengths

  • Combines raster and vector layers. Use tiled imagery and vector data within the same map.
  • Supports alternate map projections. Set the view projection and register additional coordinate systems when needed.

Limitations

  • Coordinates must match the projection. Transform longitude and latitude before using the default projected view.

Quickstart

From quickstart.html
$ npm install ol
import Map from 'ol/Map.js';
import View from 'ol/View.js';
import TileLayer from 'ol/layer/Tile.js';
import OSM from 'ol/source/OSM.js';
import 'ol/ol.css';
const map = new Map({ target: 'map', layers: [new TileLayer({ source: new OSM() })], view: new View({ center: [0, 0], zoom: 2 }) });

Creates three-dimensional globes and two-dimensional maps in a web browser without a plugin.

Downloads / mo
1.7M
Stars
16.0K
Last release
1.147.0
License
Apache-2.0

Quickstart

From Viewer.html
$ npm install cesium
import { Viewer } from 'cesium';
import 'cesium/Build/Cesium/Widgets/widgets.css';
window.CESIUM_BASE_URL = '/cesium/';
const viewer = new Viewer('map', { baseLayer: false, baseLayerPicker: false, geocoder: false });

CesiumJS examples

From open-source projects on GitHub

ArcGIS Maps SDK for JavaScript

Provides an ArcGIS API for two-dimensional and three-dimensional mapping and data visualization.

Downloads / mo
1.2M
Last release
5.2.6
License
Esri Master License Agreement

Quickstart

From webmap.js
$ npm install @arcgis/core
import WebMap from '@arcgis/core/WebMap.js';
import esriConfig from '@arcgis/core/config.js';
esriConfig.request.useIdentity = false;
const map = new WebMap({ portalItem: { id: '3d52817a120b477db912add2e62ef9b6' } });
await map.load();

ArcGIS Maps SDK for JavaScript examples

From open-source projects on GitHub

FAQ

Leaflet suits interactive flat maps with markers and popups. MapLibre GL JS suits vector-tile maps rendered with WebGL. CesiumJS suits three-dimensional globes.

Leaflet builds maps from raster tiles and DOM layers without an account. Mapbox GL JS renders vector maps with WebGL and requires an active Mapbox account under the Mapbox terms of service.

MapLibre GL JS is a BSD-licensed community fork of Mapbox GL JS. Mapbox GL JS requires a Mapbox account and the Mapbox terms of service.

OpenLayers displays raster and vector geospatial data with configurable map projections. A separate bridge, OL-Cesium, adds a globe view.

CesiumJS creates three-dimensional globes and two-dimensional maps in a web browser. It can load external terrain and imagery into its scene.

For coding agents

Found your maps library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official