mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
checking of tile types in openlayers [#3]
This commit is contained in:
@@ -54,7 +54,9 @@
|
|||||||
|
|
||||||
this._p = new pmtiles.PMTiles(options.url);
|
this._p = new pmtiles.PMTiles(options.url);
|
||||||
this._p.getHeader().then(h => {
|
this._p.getHeader().then(h => {
|
||||||
// TODO: set extent based on header
|
if (h.tileType !== pmtiles.TileType.Mvt) {
|
||||||
|
console.warn("Warning: pmtiles tile type is not mvt");
|
||||||
|
}
|
||||||
this.tileGrid.minZoom = h.minZoom;
|
this.tileGrid.minZoom = h.minZoom;
|
||||||
this.tileGrid.maxZoom = h.maxZoom;
|
this.tileGrid.maxZoom = h.maxZoom;
|
||||||
this.setTileLoadFunction(this.tileLoadFunction);
|
this.setTileLoadFunction(this.tileLoadFunction);
|
||||||
|
|||||||
@@ -34,7 +34,9 @@
|
|||||||
|
|
||||||
const p = new pmtiles.PMTiles(options.url);
|
const p = new pmtiles.PMTiles(options.url);
|
||||||
p.getHeader().then(h => {
|
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.minZoom = h.minZoom;
|
||||||
this.tileGrid.maxZoom = h.maxZoom;
|
this.tileGrid.maxZoom = h.maxZoom;
|
||||||
this.setLoader(async (z,x,y) => {
|
this.setLoader(async (z,x,y) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user