mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
js library 1.0.0 preliminary port to typescript (breaking changes)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"/>
|
||||||
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
|
||||||
<script src="https://unpkg.com/pmtiles@latest/index.js"></script>
|
<script src="https://unpkg.com/pmtiles@latest/index.js"></script>
|
||||||
<!-- <script src="../js/index.js"></script> -->
|
<!-- <script src="../js/dist/index.js"></script> -->
|
||||||
<style>
|
<style>
|
||||||
body, #map {
|
body, #map {
|
||||||
height:100vh;
|
height:100vh;
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<script>
|
<script>
|
||||||
const map = L.map('map',{maxZoom:4}).setView([0,0],0)
|
const map = L.map('map',{maxZoom:4}).setView([0,0],0)
|
||||||
const p = new pmtiles.PMTiles('osm_carto.pmtiles')
|
const p = new pmtiles.PMTiles('osm_carto.pmtiles')
|
||||||
p.leafletLayer({attribution:'© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'}).addTo(map)
|
pmtiles.leafletLayer(p,{attribution:'© <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'}).addTo(map)
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.css" crossorigin="anonymous">
|
||||||
<script src="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.js" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.js" crossorigin="anonymous"></script>
|
||||||
<script src="https://unpkg.com/pmtiles@latest/index.js"></script>
|
<script src="https://unpkg.com/pmtiles@latest/index.js"></script>
|
||||||
<!-- <script src="../js/index.js"></script> -->
|
<!-- <script src="../js/dist/index.js"></script> -->
|
||||||
<style>
|
<style>
|
||||||
body, #map {
|
body, #map {
|
||||||
height:100vh;
|
height:100vh;
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.css" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.css" crossorigin="anonymous">
|
||||||
<script src="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.js" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/maplibre-gl@1.14.1-rc.2/dist/maplibre-gl.js" crossorigin="anonymous"></script>
|
||||||
<script src="https://unpkg.com/pmtiles@0.3.1/index.js"></script>
|
<script src="https://unpkg.com/pmtiles@latest/index.js"></script>
|
||||||
|
<!-- <script src="../js/dist/index.js"></script> -->
|
||||||
<style>
|
<style>
|
||||||
body, #map {
|
body, #map {
|
||||||
height:100vh;
|
height:100vh;
|
||||||
|
|||||||
4
js/package-lock.json
generated
4
js/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "pmtiles",
|
"name": "pmtiles",
|
||||||
"version": "0.5.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pmtiles",
|
"name": "pmtiles",
|
||||||
"version": "0.5.0",
|
"version": "1.0.0",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"esbuild": "^0.11.14",
|
"esbuild": "^0.11.14",
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "pmtiles",
|
"name": "pmtiles",
|
||||||
"version": "0.5.0",
|
"version": "1.0.0",
|
||||||
"description": "PMTiles archive decoder for browsers",
|
"description": "PMTiles archive decoder for browsers",
|
||||||
"main": "index",
|
"main": "dist/pmtiles.js",
|
||||||
"module": "index.mjs",
|
"module": "dist/pmtiles.mjs",
|
||||||
"unpkg": "index.js",
|
"source": "pmtiles.ts",
|
||||||
"jsdelivr": "index.js",
|
|
||||||
"files": [
|
"files": [
|
||||||
"index.mjs",
|
"dist",
|
||||||
"index.js"
|
"pmtiles.ts"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-iife": "esbuild index.src.mjs --outfile=index.js --target=es2015 --global-name=pmtiles --format=iife",
|
"build-iife": "esbuild pmtiles.ts --outfile=dist/index.js --target=es6 --global-name=pmtiles --format=iife",
|
||||||
"build-esm": "esbuild index.src.mjs --outfile=index.mjs --target=es6 --global-name=pmtiles --format=esm",
|
"build-esm": "esbuild pmtiles.ts --outfile=dist/index.mjs --target=es6 --global-name=pmtiles --format=esm",
|
||||||
"build": "npm run build-iife && npm run build-esm",
|
"build-tsc": "tsc --declaration --outdir dist",
|
||||||
|
"build": "npm run build-iife && npm run build-esm && npm run build-tsc",
|
||||||
"test": "node -r esbuild-runner/register pmtiles.test.ts",
|
"test": "node -r esbuild-runner/register pmtiles.test.ts",
|
||||||
"tsc": "tsc --noEmit --watch"
|
"tsc": "tsc --noEmit --watch"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user