kalisio / leaflet-pmtiles

A toolset to visualise PMTiles more easily in Leaflet.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

leaflet-pmtiles

A toolset to visualise PMTiles more easily in Leaflet.js (based on https://github.com/protomaps/protomaps-leaflet).

Demos:

Build

To build distribution files locally run:

npm run dist

Getting started

See đź“‚ demo folder for examples.

To run the demos locally:

  1. launch npm run dev to build and copy distribution files into the dist/demo folder on any change,
  2. launch npm run demo in another terminal to serve and update the demo files on any change,
  3. serve your PMTiles with http-server -p 8081 --cors and adjust the URL as required in demo files,
  4. open eg http://127.0.0.1:8080/openmaptiles.html in your browser

Features

The module exposes a mapbox_style function generating paint and labels rules from a Mapbox style is a JSON document . This is typically useful to render PMTiles created from the OpenMapTiles profile.

Image

About

A toolset to visualise PMTiles more easily in Leaflet.js

License:The Unlicense


Languages

Language:JavaScript 100.0%