diff --git a/package-lock.json b/package-lock.json index bbcce07..ae9c953 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "http-shutdown": "1.2.2", "morgan": "1.10.0", "pbf": "3.2.1", - "pmtiles": "2.11.0", + "pmtiles": "3.0.0", "proj4": "2.10.0", "sanitize-filename": "1.6.3", "sharp": "0.33.2", @@ -1416,12 +1416,25 @@ "node": ">= 6" } }, + "node_modules/@types/geojson": { + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, + "node_modules/@types/leaflet": { + "version": "1.9.8", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.8.tgz", + "integrity": "sha512-EXdsL4EhoUtGm2GC2ZYtXn+Fzc6pluVgagvo2VC1RHWToLGlTRwVYoDpqS/7QXa01rmDyBjJk3Catpf60VMkwg==", + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -6694,10 +6707,11 @@ } }, "node_modules/pmtiles": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-2.11.0.tgz", - "integrity": "sha512-dU9SzzaqmCGpdEuTnIba6bDHT6j09ZJFIXxwGpvkiEnce3ZnBB1VKt6+EOmJGueriweaZLAMTUmKVElU2CBe0g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pmtiles/-/pmtiles-3.0.0.tgz", + "integrity": "sha512-rVOKfapQklKtmXQvDeOS2Zjci1oDO0U5H8Vr/LDPVWKmuZr3cqbG2XVQMi6xmB8vdCj4cHER9M3GH8U18xUB+g==", "dependencies": { + "@types/leaflet": "^1.9.8", "fflate": "^0.8.0" } }, diff --git a/package.json b/package.json index d920843..72eecc6 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "http-shutdown": "1.2.2", "morgan": "1.10.0", "pbf": "3.2.1", - "pmtiles": "2.11.0", + "pmtiles": "3.0.0", "proj4": "2.10.0", "sanitize-filename": "1.6.3", "sharp": "0.33.2", diff --git a/src/pmtiles_adapter.js b/src/pmtiles_adapter.js index cab3f54..3987681 100644 --- a/src/pmtiles_adapter.js +++ b/src/pmtiles_adapter.js @@ -1,5 +1,5 @@ import fs from 'node:fs'; -import PMTiles from 'pmtiles'; +import { PMTiles, FetchSource } from 'pmtiles'; import { isValidHttpUrl } from './utils.js'; class PMTilesFileSource { @@ -45,12 +45,12 @@ export function openPMtiles(FilePath) { let pmtiles = undefined; if (isValidHttpUrl(FilePath)) { - const source = new PMTiles.FetchSource(FilePath); - pmtiles = new PMTiles.PMTiles(source); + const source = new FetchSource(FilePath); + pmtiles = new PMTiles(source); } else { const fd = fs.openSync(FilePath, 'r'); const source = new PMTilesFileSource(fd); - pmtiles = new PMTiles.PMTiles(source); + pmtiles = new PMTiles(source); } return pmtiles; }