3.0.5 • Published 2 months ago

pmtiles v3.0.5

Weekly downloads
5
License
BSD-3-Clause
Repository
-
Last release
2 months ago

PMTiles for Browsers + NodeJS

See the JavaScript API docs

the PMTiles package can be included via script tag or ES6 module:

 <script src="https://unpkg.com/pmtiles@<VERSION>/dist/pmtiles.js"></script>

All the PMTiles exports are available under the global pmtiles variable e.g. pmtiles.PMTiles.

As an ES6 module: npm add pmtiles

import { PMTiles } from "pmtiles";

Leaflet: Raster tileset

Example of a raster PMTiles archive displayed in Leaflet:

import { PMTiles, leafletRasterLayer } from "pmtiles";
const p = new PMTiles('example.pmtiles')
leafletRasterLayer(p,{attribution:'© <a href="https://openstreetmap.org">OpenStreetMap</a>'}).addTo(map)

Live example | Code

Leaflet: Vector tileset

See protomaps-leaflet

MapLibre GL JS

Example of a PMTiles archive displayed in MapLibre GL JS:

 import { Protocol } from "pmtiles";
let protocol = new Protocol();
maplibregl.addProtocol("pmtiles",protocol.tile);
var style = {
"version": 8,
"sources": {
    "example_source": {
        "type": "vector",
        "url": "pmtiles://https://example.com/example.pmtiles",
        "attribution": '© <a href="https://openstreetmap.org">OpenStreetMap</a>'
    ...

Live example | Code

CORS

See the Protomaps Docs on Cloud Storage for uploading and configuring CORS for Cloudflare R2, Amazon S3, Google Cloud Storage and more.

3.0.5

2 months ago

3.0.4

2 months ago

3.0.3

3 months ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

3 months ago

3.0.0-alpha.1

3 months ago

3.0.0-alpha.2

3 months ago

3.0.0-alpha.0

3 months ago

2.11.0

7 months ago

2.8.0-beta.0

12 months ago

2.10.0

9 months ago

2.10.0-beta.0

10 months ago

2.9.0

11 months ago

2.8.0

11 months ago

2.7.2

1 year ago

2.7.1

1 year ago

2.3.0

2 years ago

2.2.0

2 years ago

2.5.0

1 year ago

2.4.0

2 years ago

2.7.0

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.1

1 year ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.2

3 years ago

0.1.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago