tileserver-gl-light 4.10.1 → 4.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/pmtiles_adapter.js +4 -4
- package/src/serve_data.js +0 -6
- package/src/server.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tileserver-gl-light",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.3",
|
|
4
4
|
"description": "Map tile server for JSON GL styles - serving vector tiles",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": "src/main.js",
|
|
@@ -22,21 +22,21 @@
|
|
|
22
22
|
"@mapbox/polyline": "^1.2.1",
|
|
23
23
|
"@mapbox/sphericalmercator": "1.2.0",
|
|
24
24
|
"@mapbox/vector-tile": "1.3.1",
|
|
25
|
-
"@maplibre/maplibre-gl-style-spec": "20.1.
|
|
25
|
+
"@maplibre/maplibre-gl-style-spec": "20.1.1",
|
|
26
26
|
"@sindresorhus/fnv1a": "3.1.0",
|
|
27
27
|
"advanced-pool": "0.3.3",
|
|
28
28
|
"axios": "^1.6.7",
|
|
29
|
-
"chokidar": "3.
|
|
29
|
+
"chokidar": "3.6.0",
|
|
30
30
|
"clone": "2.1.2",
|
|
31
31
|
"color": "4.2.3",
|
|
32
|
-
"commander": "
|
|
32
|
+
"commander": "12.0.0",
|
|
33
33
|
"cors": "2.8.5",
|
|
34
34
|
"express": "4.18.2",
|
|
35
35
|
"handlebars": "4.7.8",
|
|
36
36
|
"http-shutdown": "1.2.2",
|
|
37
37
|
"morgan": "1.10.0",
|
|
38
38
|
"pbf": "3.2.1",
|
|
39
|
-
"pmtiles": "
|
|
39
|
+
"pmtiles": "3.0.4",
|
|
40
40
|
"proj4": "2.10.0",
|
|
41
41
|
"sanitize-filename": "1.6.3",
|
|
42
42
|
"tileserver-gl-styles": "2.0.0"
|
package/src/pmtiles_adapter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import PMTiles from 'pmtiles';
|
|
2
|
+
import { PMTiles, FetchSource } from 'pmtiles';
|
|
3
3
|
import { isValidHttpUrl } from './utils.js';
|
|
4
4
|
|
|
5
5
|
class PMTilesFileSource {
|
|
@@ -45,12 +45,12 @@ export function openPMtiles(FilePath) {
|
|
|
45
45
|
let pmtiles = undefined;
|
|
46
46
|
|
|
47
47
|
if (isValidHttpUrl(FilePath)) {
|
|
48
|
-
const source = new
|
|
49
|
-
pmtiles = new PMTiles
|
|
48
|
+
const source = new FetchSource(FilePath);
|
|
49
|
+
pmtiles = new PMTiles(source);
|
|
50
50
|
} else {
|
|
51
51
|
const fd = fs.openSync(FilePath, 'r');
|
|
52
52
|
const source = new PMTilesFileSource(fd);
|
|
53
|
-
pmtiles = new PMTiles
|
|
53
|
+
pmtiles = new PMTiles(source);
|
|
54
54
|
}
|
|
55
55
|
return pmtiles;
|
|
56
56
|
}
|
package/src/serve_data.js
CHANGED
|
@@ -69,12 +69,6 @@ export const serve_data = {
|
|
|
69
69
|
headers['Content-Type'] = 'application/x-protobuf';
|
|
70
70
|
} else if (format === 'geojson') {
|
|
71
71
|
headers['Content-Type'] = 'application/json';
|
|
72
|
-
|
|
73
|
-
if (isGzipped) {
|
|
74
|
-
data = zlib.unzipSync(data);
|
|
75
|
-
isGzipped = false;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
72
|
const tile = new VectorTile(new Pbf(data));
|
|
79
73
|
const geojson = {
|
|
80
74
|
type: 'FeatureCollection',
|
package/src/server.js
CHANGED
|
@@ -380,14 +380,14 @@ function start(opts) {
|
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
app.get('/(:tileSize(256|512)/)?rendered.json', (req, res, next) => {
|
|
383
|
-
const tileSize = parseInt(req.params.tileSize, 10) ||
|
|
383
|
+
const tileSize = parseInt(req.params.tileSize, 10) || undefined;
|
|
384
384
|
res.send(addTileJSONs([], req, 'rendered', tileSize));
|
|
385
385
|
});
|
|
386
386
|
app.get('/data.json', (req, res, next) => {
|
|
387
387
|
res.send(addTileJSONs([], req, 'data', undefined));
|
|
388
388
|
});
|
|
389
389
|
app.get('/(:tileSize(256|512)/)?index.json', (req, res, next) => {
|
|
390
|
-
const tileSize = parseInt(req.params.tileSize, 10) ||
|
|
390
|
+
const tileSize = parseInt(req.params.tileSize, 10) || undefined;
|
|
391
391
|
res.send(
|
|
392
392
|
addTileJSONs(
|
|
393
393
|
addTileJSONs([], req, 'rendered', tileSize),
|