js 2.9; pass header bounds through maplibre protocol

This commit is contained in:
Brandon Liu
2023-06-22 14:32:11 +08:00
parent 56f5a7c179
commit 181c9efb7e
7 changed files with 12 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
2.9.0
* Recognize AVIF TileType
* MapLibre adapter internally passes bounds from PMTiles header
2.8.0
* Polyfill `DecompressionStream` using 101arrowz/compression-streams-polyfill

View File

@@ -123,8 +123,6 @@ export class Protocol {
this.tiles.set(pmtiles_url, instance);
}
// TODO: create vector_layers if present to return valid TileJSON
instance
.getHeader()
.then((h) => {
@@ -132,6 +130,7 @@ export class Protocol {
tiles: [params.url + "/{z}/{x}/{y}"],
minzoom: h.minZoom,
maxzoom: h.maxZoom,
bounds: [h.minLon, h.minLat, h.maxLon, h.maxLat],
};
callback(null, tilejson, null, null);
})

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.9.0/dist/leaflet.js"></script>
<script src="https://unpkg.com/pmtiles@2.8.0/dist/index.js"></script>
<script src="https://unpkg.com/pmtiles@2.9.0/dist/index.js"></script>
<style>
body, #map {
height:100vh;

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/pmtiles@2.8.0/dist/index.js"></script>
<script src="https://unpkg.com/pmtiles@2.9.0/dist/index.js"></script>
<style>
body {
margin: 0;

View File

@@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/pmtiles@2.8.0/dist/index.js"></script>
<script src="https://unpkg.com/pmtiles@2.9.0/dist/index.js"></script>
<style>
body {
margin: 0;

4
js/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "pmtiles",
"version": "2.8.0",
"version": "2.9.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pmtiles",
"version": "2.8.0",
"version": "2.9.0",
"license": "BSD-3-Clause",
"dependencies": {
"compression-streams-polyfill": "^0.1.3",

View File

@@ -1,6 +1,6 @@
{
"name": "pmtiles",
"version": "2.8.0",
"version": "2.9.0",
"description": "PMTiles archive decoder for browsers",
"main": "dist/index.cjs",
"module": "dist/index.mjs",