checking of tile types in openlayers [#3]

This commit is contained in:
Brandon Liu
2023-04-26 19:54:24 +02:00
parent fb0ea53ea2
commit 9b0e473d30
2 changed files with 6 additions and 2 deletions

View File

@@ -34,7 +34,9 @@
const p = new pmtiles.PMTiles(options.url);
p.getHeader().then(h => {
// TODO: set extent based on header
if (h.tileType !== pmtiles.TileType.Jpeg && h.tileType !== pmtiles.TileType.Png && h.tileType !== pmtiles.TileType.Webp) {
console.warn("Warning: pmtiles tile type is not jpeg, png, or webp");
}
this.tileGrid.minZoom = h.minZoom;
this.tileGrid.maxZoom = h.maxZoom;
this.setLoader(async (z,x,y) => {