# JavaScript maps libraries

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

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Leaflet](#leaflet) | 44.5M | 46.0K | May 2023 | BSD-2-Clause |
| [maplibre-gl](#maplibre-gl-js) | 38.3M | 12.1K | Nov 2026 | BSD-3-Clause |
| [@googlemaps/js-api-loader](#googlemaps-js-api-loader) | 31.4M | 452 | Sep 2026 | Apache-2.0 |
| [mapbox-gl](#mapbox-gl-js) | 23.0M | 12.5K | Nov 2026 | Mapbox TOS |
| [deck.gl](#deck-gl-core) | 5.5M | 14.8K | Oct 2026 | MIT |
| [OpenLayers](#openlayers) | 4.4M | 12.7K | Oct 2026 | BSD-2-Clause |
| [CesiumJS](#cesium) | 1.7M | 16.0K | Nov 2026 | Apache-2.0 |
| [ArcGIS Maps SDK for JavaScript](#arcgis-core) | 1.2M | Not on GitHub | Nov 2026 | Esri Master License Agreement |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Leaflet](#leaflet) has the most monthly downloads in this comparison, at 43.5M.

## Capabilities

| Library | Globe view | Point clustering |
| --- | --- | --- |
| [Leaflet](#leaflet) | No | Via plugin |
| [maplibre-gl](#maplibre-gl-js) | Yes | Yes |
| [@googlemaps/js-api-loader](#googlemaps-js-api-loader) | Undocumented | Via plugin |
| [mapbox-gl](#mapbox-gl-js) | Yes | Yes |
| [deck.gl](#deck-gl-core) | Yes | Via plugin |
| [OpenLayers](#openlayers) | Via plugin | Yes |
| [CesiumJS](#cesium) | Yes | Yes |
| [ArcGIS Maps SDK for JavaScript](#arcgis-core) | Yes | Yes |

## Libraries

### Leaflet

[GitHub](https://github.com/Leaflet/Leaflet) · [npm](https://www.npmjs.com/package/leaflet) · [Docs](https://leafletjs.com/)

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
- Capabilities: [From the Leaflet docs](https://leafletjs.com/)

**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.

**Watch out for**

- **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.

```sh
npm install leaflet
```

**jupyter-widgets/ipyleaflet** (1.5K stars)

[jupyter-widgets/ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) 

```typescript
_processLuminoMessage(msg: Message, _super: Function) {
    _super.call(this, msg);
    if (!this.obj) return;
    switch (msg.type) {
      case 'resize':
        // We set the dirty flag to true to prevent the sub-pixel error
        // on the new center to be reflected on the model.
        this.dirty = true;
        // On the pan option:
        // `pan=true`  causes the center to be unchanged upon resize (up
        // to sub-pixel differences)
        // `pan=false` corresponds to having to top-left corner
        // unchanged.
        this.obj.invalidateSize({
          animate: false,
          pan: true,
        });
        this.dirty = false;
        break;
      case 'after-show':
        this.dirty = true;
        // If we are in a jupyter-widget tab, we get an after-show before
        // this.displayed is resolved. In this case, obj is not created yet.
        this.obj.invalidateSize({
          animate: false,
          pan: true,
        });
        this.dirty = false;
        break;
    }
  }
```

[python/jupyter_leaflet/src/Map.ts](https://github.com/jupyter-widgets/ipyleaflet/blob/612f4ebb800e50c0bae84e4d2b6bd3e622b7a12c/python/jupyter_leaflet/src/Map.ts#L460-L490) · [More projects using Leaflet →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20leaflet%20for%20widget%20resize%20handling%2C%20loaded-style%20synchronization%20and%20terrain%20source%20checks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```typescript
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);

```

From [example.md](https://leafletjs.com/reference-1.9.4.html)

### maplibre-gl

[GitHub](https://github.com/maplibre/maplibre-gl-js) · [npm](https://www.npmjs.com/package/maplibre-gl) · [Docs](https://maplibre.org/)

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
- Capabilities: [From the maplibre-gl docs](https://maplibre.org/)

**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.

**Watch out for**

- **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.

```sh
npm install maplibre-gl
```

**Quickstart**

```typescript
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 });

```

From [Map.md](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) · [Find projects using maplibre-gl →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20maplibre-gl%20for%20widget%20resize%20handling%2C%20loaded-style%20synchronization%20and%20terrain%20source%20checks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### @googlemaps/js-api-loader

[GitHub](https://github.com/googlemaps/js-api-loader) · [npm](https://www.npmjs.com/package/@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
- Capabilities: [From the @googlemaps/js-api-loader docs](https://github.com/googlemaps/js-api-loader)

```sh
npm install @googlemaps/js-api-loader
```

**Quickstart**

```typescript
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 });

```

From [README.md](https://github.com/googlemaps/js-api-loader) · [Find projects using @googlemaps/js-api-loader →](https://dashboard.exa.ai/playground/search?q=%40googlemaps/js-api-loader%20GitHub%20projects)

### mapbox-gl

[GitHub](https://github.com/mapbox/mapbox-gl-js) · [npm](https://www.npmjs.com/package/mapbox-gl) · [Docs](https://github.com/mapbox/mapbox-gl-js#readme)

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
- Capabilities: [From the mapbox-gl docs](https://github.com/mapbox/mapbox-gl-js#readme)

**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.

**Watch out for**

- **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.

```sh
npm install mapbox-gl
```

**Quickstart**

```typescript
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 });

```

From [map.md](https://docs.mapbox.com/mapbox-gl-js/api/map/) · [Find projects using mapbox-gl →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20mapbox-gl%20for%20widget%20resize%20handling%2C%20loaded-style%20synchronization%20and%20terrain%20source%20checks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### deck.gl

[GitHub](https://github.com/visgl/deck.gl) · [npm](https://www.npmjs.com/package/@deck.gl/core) · [Docs](https://deck.gl)

Provides the core of the deck.gl visualization framework.

- Downloads / mo: 5.5M
- Stars: 14.8K
- Last release: 9.4.1
- License: MIT
- Capabilities: [From the deck.gl docs](https://deck.gl)

```sh
npm install @deck.gl/core@9.4.1 @deck.gl/layers@9.4.1
```

**keplergl/kepler.gl** (12.1K stars)

[keplergl/kepler.gl](https://github.com/keplergl/kepler.gl) 

```typescript
export function pointToPolygonGeo({
  object,
  cellSize,
  coverage,
  properties,
  mapState,
  coordinate
}: {
  object: any;
  cellSize: number;
  coverage: number;
  properties?: any;
  mapState: MapState;
  coordinate?: number[];
}) {
  const position = object.position || coordinate;
  const viewport = new WebMercatorViewport(mapState);

  if (!position) {
    return null;
  }

  return {
    geometry: {
      coordinates: [
        viewport.addMetersToLngLat(position, [
          cellSize * (0.5 - coverage / 2),
          cellSize * (0.5 - coverage / 2)
        ]),
        viewport.addMetersToLngLat(position, [
          cellSize * (0.5 + coverage / 2),
          cellSize * (0.5 - coverage / 2)
        ]),
        viewport.addMetersToLngLat(position, [
          cellSize * (0.5 + coverage / 2),
          cellSize * (0.5 + coverage / 2)
        ]),
        viewport.addMetersToLngLat(position, [
          cellSize * (0.5 - coverage / 2),
          cellSize * (0.5 + coverage / 2)
        ]),
        viewport.addMetersToLngLat(position, [
          cellSize * (0.5 - coverage / 2),
          cellSize * (0.5 - coverage / 2)
        ])
      ],
      type: 'LineString'
    },
    properties
  };
}
```

[src/layers/src/grid-layer/grid-utils.ts](https://github.com/keplergl/kepler.gl/blob/21d68ea38b4410d1275516f27fef7442419958b1/src/layers/src/grid-layer/grid-utils.ts) · [More projects using deck.gl →](https://dashboard.exa.ai/playground/search?q=%40deck.gl/core%20GitHub%20projects)

**Quickstart**

```typescript
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] })]
});

```

From [deck.md](https://deck.gl/docs/api-reference/core/deck)

### OpenLayers

[GitHub](https://github.com/openlayers/openlayers) · [npm](https://www.npmjs.com/package/ol) · [Docs](https://openlayers.org/)

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
- Capabilities: [From the OpenLayers docs](https://openlayers.org/)

**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.

**Watch out for**

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

```sh
npm install ol
```

**Quickstart**

```javascript
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 }) });

```

From [quickstart.html](https://github.com/openlayers/openlayers/blob/88fc44564552176b761dbb9531f9977386d041c0/examples/cluster.js) · [Find projects using OpenLayers →](https://dashboard.exa.ai/playground/search?q=JavaScript%20TypeScript%20projects%20using%20ol%20for%20widget%20resize%20handling%2C%20loaded-style%20synchronization%20and%20terrain%20source%20checks&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### CesiumJS

[GitHub](https://github.com/CesiumGS/cesium) · [npm](https://www.npmjs.com/package/cesium) · [Docs](http://cesium.com/cesiumjs/)

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
- Capabilities: [From the CesiumJS docs](http://cesium.com/cesiumjs/)

```sh
npm install cesium
```

**openlayers/ol-cesium** (1.2K stars)

[openlayers/ol-cesium](https://github.com/openlayers/ol-cesium) 

```javascript
setPosition(position: number[]) {
    if (!this.toLonLat_) {
      return;
    }
    const ll = this.toLonLat_(position);
    console.assert(!!ll);

    const carto = new Cesium.Cartographic(
      toRadians(ll[0]),
      toRadians(ll[1]),
      this.getAltitude(),
    );

    this.cam_.setView({
      destination: Cesium.Ellipsoid.WGS84.cartographicToCartesian(carto),
    });
    this.updateView();
  }

```

[src/olcs/Camera.ts](https://github.com/openlayers/ol-cesium/blob/5fe9a69943a20d7734f7d2e6efb35d0e54c552a8/src/olcs/Camera.ts#L202-L219) · [More projects using CesiumJS →](https://dashboard.exa.ai/playground/search?q=cesium%20GitHub%20projects)

**Quickstart**

```javascript
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 });

```

From [Viewer.html](https://cesium.com/learn/cesiumjs/ref-doc/Viewer.html)

### ArcGIS Maps SDK for JavaScript

[npm](https://www.npmjs.com/package/@arcgis/core) · [Docs](https://js.arcgis.com)

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
- Capabilities: [From the ArcGIS Maps SDK for JavaScript docs](https://js.arcgis.com)

```sh
npm install @arcgis/core
```

**Esri/jsapi-resources** (782 stars)

[Esri/jsapi-resources](https://github.com/Esri/jsapi-resources) 

```javascript
const addLegend = () => {
  // Add legend div to the map
  document.getElementById("customLegend").style.display = "block";

  // Add center symbol to legend
  symbolUtils.renderPreviewHTML(markerSymbol, {
    node: document.getElementById("centerPointDiv"),
    size: { width: 10, height: 10 },
    symbolConfig: { isSquareFill: true },
  });

  // Add query buffer symbol to legend
  symbolUtils.renderPreviewHTML(greenLineSymbol, {
    node: document.getElementById("queryBufferDiv"),
  });

  // Add river symbol to legend
  symbolUtils.renderPreviewHTML(blueLineSymbol, {
    node: document.getElementById("riversAndStreamsDiv"),
  });

  // Add river buffer symbol to legend
  symbolUtils.renderPreviewHTML(redLineSymbol, {
    node: document.getElementById("buffersDiv"),
  });
};
```

[templates/geometry-operator-worker/src/main.js](https://github.com/Esri/jsapi-resources/blob/6dbedffd2890e4856a105a20b064ef87c8417cd6/templates/geometry-operator-worker/src/main.js#L110-L135) · [More projects using ArcGIS Maps SDK for JavaScript →](https://dashboard.exa.ai/playground/search?q=%40arcgis/core%20GitHub%20projects)

**Quickstart**

```javascript
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();

```

From [webmap.js](https://github.com/Esri/jsapi-resources/blob/6dbedffd2890e4856a105a20b064ef87c8417cd6/templates/js-maps-sdk-node/webmap.js)

## FAQ

### Which JavaScript map library should I use?

[Leaflet](#leaflet) suits interactive flat maps with markers and popups. [MapLibre GL JS](#maplibre-gl-js) suits vector-tile maps rendered with WebGL. [CesiumJS](#cesium) suits three-dimensional globes.

### Leaflet vs Mapbox: which should I use?

[Leaflet](#leaflet) builds maps from raster tiles and DOM layers without an account. [Mapbox GL JS](#mapbox-gl-js) renders vector maps with WebGL and requires an active Mapbox account under the Mapbox terms of service.

### MapLibre vs Mapbox: which should I use?

[MapLibre GL JS](#maplibre-gl-js) is a BSD-licensed community fork of Mapbox GL JS. [Mapbox GL JS](#mapbox-gl-js) requires a Mapbox account and the Mapbox terms of service.

### What is OpenLayers?

[OpenLayers](#openlayers) displays raster and vector geospatial data with configurable map projections. A separate bridge, OL-Cesium, adds a globe view.

### What is CesiumJS?

[CesiumJS](#cesium) creates three-dimensional globes and two-dimensional maps in a web browser. It can load external terrain and imagery into its scene.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best JavaScript map libraries Leaflet MapLibre OpenLayers Mapbox GL code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
