https://github.com/allartk/leaflet.offline
Leaflet offline layer
https://github.com/allartk/leaflet.offline
leaflet-plugins
Last synced: 1 day ago
JSON representation
Leaflet offline layer
- Host: GitHub
- URL: https://github.com/allartk/leaflet.offline
- Owner: allartk
- License: lgpl-3.0
- Created: 2014-07-25T13:44:19.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2026-02-04T10:44:46.000Z (8 days ago)
- Last Synced: 2026-02-04T23:28:45.922Z (7 days ago)
- Topics: leaflet-plugins
- Language: TypeScript
- Homepage: https://allartk.github.io/leaflet.offline/
- Size: 6.8 MB
- Stars: 358
- Watchers: 12
- Forks: 81
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# leaflet.offline
[](https://badge.fury.io/js/leaflet.offline)
[](https://codecov.io/github/allartk/leaflet.offline)
[](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
```