Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js 2.9; pass header bounds through maplibre protocol #203

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions js/adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ export class Protocol {
this.tiles.set(pmtiles_url, instance);
}

// TODO: create vector_layers if present to return valid TileJSON

instance
.getHeader()
.then((h) => {
const tilejson = {
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);
})
Expand Down
2 changes: 1 addition & 1 deletion js/examples/leaflet.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/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;
Expand Down
2 changes: 1 addition & 1 deletion js/examples/maplibre.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/[email protected]/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;
Expand Down
2 changes: 1 addition & 1 deletion js/examples/maplibre_raster_dem.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" crossorigin="anonymous">
<script src="https://unpkg.com/[email protected]/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;
Expand Down
4 changes: 2 additions & 2 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down