From 181c9efb7e507e7c9b59d82ed06757355e1096ce Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 22 Jun 2023 14:32:11 +0800 Subject: [PATCH] js 2.9; pass header bounds through maplibre protocol --- js/CHANGELOG.md | 5 +++++ js/adapters.ts | 3 +-- js/examples/leaflet.html | 2 +- js/examples/maplibre.html | 2 +- js/examples/maplibre_raster_dem.html | 2 +- js/package-lock.json | 4 ++-- js/package.json | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/js/CHANGELOG.md b/js/CHANGELOG.md index 6ed77473..09604dd8 100644 --- a/js/CHANGELOG.md +++ b/js/CHANGELOG.md @@ -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 diff --git a/js/adapters.ts b/js/adapters.ts index 82d124e1..51a8035a 100644 --- a/js/adapters.ts +++ b/js/adapters.ts @@ -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); }) diff --git a/js/examples/leaflet.html b/js/examples/leaflet.html index c0f8f3e3..4ab06979 100644 --- a/js/examples/leaflet.html +++ b/js/examples/leaflet.html @@ -4,7 +4,7 @@ - +