tilfluktsrom/pwa/node_modules/leaflet.offline
Ole-Morten Duesund e8428de775 Add progressive web app companion for cross-platform access
Vite + TypeScript PWA that mirrors the Android app's core features:
- Pre-processed shelter data (build-time UTM33N→WGS84 conversion)
- Leaflet map with shelter markers, user location, and offline tiles
- Canvas compass arrow (ported from DirectionArrowView.kt)
- IndexedDB shelter cache with 7-day staleness check
- Service worker with CacheFirst tiles and precached app shell
- i18n for en, nb, nn (ported from Android strings.xml)
- iOS/Android compass handling with low-pass filter
- Respects user map interaction (no auto-snap on pan/zoom)
- Build revision cache-breaker for reliable SW updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:41:38 +01:00
..
.github Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.husky Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
coverage/Chrome w/o sandbox Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
dist Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
examples Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
src Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
test Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.browserslistrc Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.commitlintrc.json Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.eslintrc.js Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.nvmrc Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.prettierignore Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.prettierrc.json Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
.releaserc.json Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
changelog.md Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
karma.conf.ts Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
leaflet.offline-3.0.1.tgz Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
LICENSE Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
package.json Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
README.md Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
rollup.config.mjs Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00
tsconfig.json Add progressive web app companion for cross-platform access 2026-03-08 17:41:38 +01:00

leaflet.offline

npm version codecov Build Status

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.

Dependencies

Install

With npm

The package and it's dependencies can also be downloaded into your existing project with npm:

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
  • 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

Api

Generate docs with

npm run-script docs