Skip to content

Commit

Permalink
Merge pull request #16 from am2222/am2222-patch-1
Browse files Browse the repository at this point in the history
Update index.ts
  • Loading branch information
am2222 authored Jun 11, 2024
2 parents 5adb6e4 + 617e1bd commit a3bba2f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ export class PmTilesSource extends VectorTileSourceImpl {
this._tileJSONRequest = Promise.all([this._instance.getHeader(), this._instance.getMetadata()]).then(([header, tileJSON]: any) => {
//first we set some of the header properties to the source using tileJSON
extend(this, tileJSON);
// fix for the corrupted tilejson
this.minzoom = Number.parseInt(this.minzoom.toString()) || 0;
this.maxzoom = Number.parseInt(this.maxzoom.toString()) || 0;


// we set min and max zoom from the header
this.header = header;
Expand All @@ -320,7 +318,10 @@ export class PmTilesSource extends VectorTileSourceImpl {
if (this.maxzoom == undefined) {
console.warn('The maxzoom parameter is not defined in the source json. This can cause memory leak. So make sure to define maxzoom in the layer')
}

// fix for the corrupted tilejson
this.minzoom = Number.parseInt(this.minzoom.toString()) || 0;
this.maxzoom = Number.parseInt(this.maxzoom.toString()) || 0;

this._tileJSONRequest = undefined;
this._loaded = true;

Expand Down Expand Up @@ -516,4 +517,4 @@ export class PmTilesSource extends VectorTileSourceImpl {
}
}

export default PmTilesSource
export default PmTilesSource

0 comments on commit a3bba2f

Please sign in to comment.