diff --git a/js/README.md b/js/README.md index 3cddade..e6d38be 100644 --- a/js/README.md +++ b/js/README.md @@ -1,8 +1,16 @@ -the [PMTiles](https://www.npmjs.com/package/pmtiles) package can be included via script tag or ES6 module. +the [PMTiles](https://www.npmjs.com/package/pmtiles) package can be included via script tag or ES6 module: -## Leaflet +```html + + ``` -### Raster tileset + As an ES6 module: `npm add pmtiles` + + ```js + import * as pmtiles from "pmtiles"; + ``` + +### Leaflet: Raster tileset Example of a raster PMTiles archive displayed in Leaflet: @@ -11,10 +19,9 @@ const p = new pmtiles.PMTiles('example.pmtiles') pmtiles.leafletRasterLayer(p,{attribution:'© OpenStreetMap'}).addTo(map) ```` - [Live example](https://protomaps.github.io/PMTiles/examples/leaflet.html) | [Code](https://github.com/protomaps/PMTiles/blob/master/js/examples/leaflet.html) -### Vector tileset +### Leaflet: Vector tileset See [protomaps.js](https://github.com/protomaps/protomaps.js)