# leaflet.offline

> Offline tilelayer for leaflet

Latest version **3.2.1** (published 2026-02-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install leaflet.offline
pnpm add leaflet.offline
yarn add leaflet.offline
bun add leaflet.offline
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.2.1 |
| Published | 2026-02-10 |
| First published | 2017-02-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 464.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 375 |
| Author | Allart Kooiman |
| Maintainers | allartk |
| Keywords | leaflet, offline |

## Links

- npm: https://www.npmjs.com/package/leaflet.offline
- Repository: https://github.com/allartk/leaflet.offline
- Issues: https://github.com/allartk/leaflet.offline/issues
- npm.io page: https://npm.io/package/leaflet.offline

## Dependencies (2)

- [idb](https://npm.io/package/idb.md) ^8.0.2
- [leaflet](https://npm.io/package/leaflet.md) ^1.6.0

## Recent versions

- 3.2.1 (latest) — 2026-02-10
- 3.0.0-rc.4 (next) — 2022-11-30
- 3.2.0 — 2025-11-15
- 3.1.0 — 2024-08-01
- 3.0.1 — 2023-09-03
- 3.0.0 — 2023-01-11
- 3.0.0-rc.3 — 2022-11-30
- 3.0.0-rc.2 — 2022-10-26
- 3.0.0-rc.1 — 2022-06-29
- 2.2.0 — 2022-03-31
- 2.1.0 — 2021-11-27
- 2.0.1 — 2021-11-12
- 2.0.0 — 2021-11-12
- 2.0.0-beta.4 — 2020-09-16
- 2.0.0-beta.3 — 2020-07-29
- … 17 more at https://npm.io/package/leaflet.offline/versions

## README

# leaflet.offline

[![npm version](https://badge.fury.io/js/leaflet.offline.svg)](https://badge.fury.io/js/leaflet.offline)
[![codecov](https://codecov.io/github/allartk/leaflet.offline/graph/badge.svg?token=dy1uNlSvsh)](https://codecov.io/github/allartk/leaflet.offline)
[![Build Status](https://travis-ci.org/allartk/leaflet.offline.png?branch=master)](https://travis-ci.org/allartk/leaflet.offline)

This library can be used to create maps, which are still available when you are offline and are fast when your connection is not. It works in the browser or can be used in an mobile app based on html and in progressive webapps.

- [examples](https://github.com/allartk/leaflet.offline/tree/main/examples)

## Dependencies

- [Leafletjs](http://leafletjs.com/)
- [idb](https://www.npmjs.com/package/idb) To store the tiles with promises

## Install

### With npm

The package and it's dependencies can also be downloaded into
your existing project with [npm](http://npmjs.com):

```
npm install leaflet.offline
```

In your script add:

```
import 'leaflet.offline'
```

### Manual

Unpack the file for the release (find them under the releasestab ) and add dist/bundle.js in a script tag
to your page (after leaflet and idb).

### Development

For running the example locally, you'll need to clone the project and run:

```
npm i && npm run build
cd docs
npm install && npm run start
```

**pull requests welcome**

* You MUST test your code with `npm test` and  `npm run lint`. On wsl wit ubuntu 24.04, install first libasound, libnss3: `sudo apt install libasound2t64 libnss3`, see [puppeteer docs](https://pptr.dev/guides/system-requirements)
* Please one feature at a time, if you can split your PR, please do so.
* Also, do not mix a feature with package updates.
* [Use commit message conventions](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#rules)

## Api

Generate docs with

```
npm run-script docs
```

---
_Source: https://npm.io/package/leaflet.offline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
