tileserver-gl-light 5.5.0-pre.5 → 5.5.0-pre.6
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/CHANGELOG.md +3 -1
- package/docs/config.rst +11 -10
- package/docs/usage.rst +21 -0
- package/package.json +5 -5
- package/public/resources/maplibre-gl-inspect.js +12 -8
- package/public/resources/maplibre-gl-inspect.js.map +1 -1
- package/public/resources/maplibre-gl.js +4 -4
- package/public/resources/maplibre-gl.js.map +1 -1
- package/src/main.js +15 -3
- package/src/pmtiles_adapter.js +27 -3
- package/src/serve_data.js +22 -11
- package/src/serve_font.js +2 -2
- package/src/serve_rendered.js +84 -49
- package/src/serve_style.js +29 -8
- package/src/server.js +87 -35
- package/src/utils.js +1 -2
- package/test/tiles_data.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tileserver-gl changelog
|
|
2
2
|
|
|
3
|
-
## 5.5.0-pre.
|
|
3
|
+
## 5.5.0-pre.6
|
|
4
4
|
* Add S3 support for PMTiles with multiple AWS credential profiles (https://github.com/maptiler/tileserver-gl/pull/1779) by @acalcutt
|
|
5
5
|
* Create .aws directory passthrough folder in Dockerfile (https://github.com/maptiler/tileserver-gl/pull/1784) by @acalcutt
|
|
6
6
|
* Update eslint to v9 (https://github.com/maptiler/tileserver-gl/pull/1473) by @acalcutt
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* Add Visual Regression Tests for Static Image Overlays (https://github.com/maptiler/tileserver-gl/pull/1792) by @acalcutt
|
|
9
9
|
* Fix S3 URL parsing for nested paths in AWS buckets (https://github.com/maptiler/tileserver-gl/pull/1819) by @acalcutt
|
|
10
10
|
* Fix Renderer Crashes and Memory Leak (https://github.com/maptiler/tileserver-gl/pull/1825) by @acalcutt
|
|
11
|
+
* Fix loading local data sources (PMTiles/MBTiles) specified in style (https://github.com/maptiler/tileserver-gl/pull/1855) by @acalcutt
|
|
12
|
+
* **BREAKING**: Change 'sparse' option default based on tile format - vector tiles (pbf) default to false (204), raster tiles default to true (404 for overzoom) by @acalcutt
|
|
11
13
|
|
|
12
14
|
## 5.4.0
|
|
13
15
|
* Fix the issue where the tile URL cannot be correctly parsed with the HTTPS protocol when using an nginx proxy service (https://github.com/maptiler/tileserver-gl/pull/1578) by @dakanggo
|
package/docs/config.rst
CHANGED
|
@@ -249,7 +249,7 @@ The data source does not need to be specified here unless you explicitly want to
|
|
|
249
249
|
Data Source Options
|
|
250
250
|
--------------
|
|
251
251
|
|
|
252
|
-
Within the top-level ``data`` object in your configuration, each defined data source (e.g., `terrain`, `
|
|
252
|
+
Within the top-level ``data`` object in your configuration, each defined data source (e.g., `terrain`, `vector_tiles`) can have several key properties. These properties define how *tileserver-gl* processes and serves the tiles from that source.
|
|
253
253
|
|
|
254
254
|
For example::
|
|
255
255
|
|
|
@@ -257,12 +257,10 @@ For example::
|
|
|
257
257
|
"terrain": {
|
|
258
258
|
"mbtiles": "terrain1.mbtiles",
|
|
259
259
|
"encoding": "mapbox",
|
|
260
|
-
"tileSize": 512
|
|
261
|
-
"sparse": true
|
|
260
|
+
"tileSize": 512
|
|
262
261
|
},
|
|
263
|
-
"
|
|
264
|
-
"pmtiles": "custom_osm.pmtiles"
|
|
265
|
-
"sparse": true
|
|
262
|
+
"vector_tiles": {
|
|
263
|
+
"pmtiles": "custom_osm.pmtiles"
|
|
266
264
|
},
|
|
267
265
|
"production-s3-tiles": {
|
|
268
266
|
"pmtiles": "s3://prod-bucket/tiles.pmtiles",
|
|
@@ -283,10 +281,13 @@ Here are the available options for each data source:
|
|
|
283
281
|
Default: ``256``.
|
|
284
282
|
|
|
285
283
|
``sparse`` (boolean)
|
|
286
|
-
Controls
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
284
|
+
Controls behavior when a tile is not found in the source.
|
|
285
|
+
|
|
286
|
+
* ``true`` - Returns HTTP 404, allowing clients like MapLibre to overzoom and use parent tiles. Use this for terrain or datasets with uneven zoom coverage.
|
|
287
|
+
* ``false`` - Returns HTTP 204 (No Content), signaling an intentionally empty tile and preventing overzoom.
|
|
288
|
+
|
|
289
|
+
This can be set globally in the top-level options or per-data-source (per-source overrides global).
|
|
290
|
+
Default: Depends on tile format - ``false`` for vector tiles (pbf), ``true`` for raster tiles (png, webp, jpg, etc.).
|
|
290
291
|
|
|
291
292
|
``s3Profile`` (string)
|
|
292
293
|
Specifies the AWS credential profile to use for S3 PMTiles sources. The profile must be defined in your ``~/.aws/credentials`` file.
|
package/docs/usage.rst
CHANGED
|
@@ -19,6 +19,7 @@ Getting started
|
|
|
19
19
|
-p, --port <port> Port [8080] (default: 8080)
|
|
20
20
|
-C|--no-cors Disable Cross-origin resource sharing headers
|
|
21
21
|
-u|--public_url <url> Enable exposing the server on subpaths, not necessarily the root of the domain
|
|
22
|
+
--fetch-timeout <ms> Timeout in milliseconds for fetching remote tiles (default: 15000)
|
|
22
23
|
-V, --verbose [level] More verbose output (level 1-3)
|
|
23
24
|
-V, --verbose, -V 1, or --verbose 1: Important operations
|
|
24
25
|
-V 2 or --verbose 2: Detailed operations
|
|
@@ -101,6 +102,26 @@ Default preview style and configuration
|
|
|
101
102
|
- If no configuration file is specified, a default preview style (compatible with openmaptiles) is used.
|
|
102
103
|
- If no data file is specified (and is not found in the current working directory), a sample file is downloaded (showing the Zurich area)
|
|
103
104
|
|
|
105
|
+
Remote tile fetching and timeouts
|
|
106
|
+
======
|
|
107
|
+
|
|
108
|
+
TileServer GL can fetch tiles from remote HTTP/HTTPS sources referenced in your style. The ``--fetch-timeout`` option controls how long the server will wait for remote tile requests before giving up.
|
|
109
|
+
|
|
110
|
+
**Default behavior:**
|
|
111
|
+
- Default timeout is 15 seconds (15000 milliseconds)
|
|
112
|
+
- If a remote tile request exceeds this timeout, an error is logged and an empty tile is returned to the renderer
|
|
113
|
+
|
|
114
|
+
**Tuning the timeout:**
|
|
115
|
+
|
|
116
|
+
If you notice timeout errors with certain remote sources, you can adjust the timeout:
|
|
117
|
+
::
|
|
118
|
+
|
|
119
|
+
# Increase timeout to 30 seconds for slower remote sources
|
|
120
|
+
tileserver-gl -c config.json --fetch-timeout 30000
|
|
121
|
+
|
|
122
|
+
# Reduce timeout to 5 seconds for faster failure
|
|
123
|
+
tileserver-gl -c config.json --fetch-timeout 5000
|
|
124
|
+
|
|
104
125
|
Reloading the configuration
|
|
105
126
|
======
|
|
106
127
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tileserver-gl-light",
|
|
3
|
-
"version": "5.5.0-pre.
|
|
3
|
+
"version": "5.5.0-pre.6",
|
|
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",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"docker": "docker build . && docker run --rm -i -p 8080:8080 $(docker build -q .)"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@aws-sdk/client-s3": "^3.
|
|
38
|
+
"@aws-sdk/client-s3": "^3.946.0",
|
|
39
39
|
"@jsse/pbfont": "^0.3.0",
|
|
40
40
|
"@mapbox/mapbox-gl-rtl-text": "0.3.0",
|
|
41
41
|
"@mapbox/mbtiles": "0.12.1",
|
|
42
42
|
"@mapbox/polyline": "^1.2.1",
|
|
43
43
|
"@mapbox/sphericalmercator": "2.0.2",
|
|
44
44
|
"@mapbox/vector-tile": "2.0.4",
|
|
45
|
-
"@maplibre/maplibre-gl-inspect": "1.8.
|
|
45
|
+
"@maplibre/maplibre-gl-inspect": "1.8.1",
|
|
46
46
|
"@maplibre/maplibre-gl-style-spec": "24.3.1",
|
|
47
47
|
"@sindresorhus/fnv1a": "3.1.0",
|
|
48
48
|
"advanced-pool": "0.3.3",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"commander": "14.0.2",
|
|
53
53
|
"copyfiles": "2.4.1",
|
|
54
54
|
"cors": "2.8.5",
|
|
55
|
-
"express": "5.1
|
|
55
|
+
"express": "5.2.1",
|
|
56
56
|
"handlebars": "4.7.8",
|
|
57
57
|
"http-shutdown": "1.2.2",
|
|
58
58
|
"leaflet": "1.9.4",
|
|
59
59
|
"leaflet-hash": "0.2.1",
|
|
60
|
-
"maplibre-gl": "5.
|
|
60
|
+
"maplibre-gl": "5.14.0",
|
|
61
61
|
"morgan": "1.10.1",
|
|
62
62
|
"pbf": "4.0.1",
|
|
63
63
|
"pmtiles": "4.3.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
function requireLodash_isequal () {
|
|
60
60
|
if (hasRequiredLodash_isequal) return lodash_isequal.exports;
|
|
61
61
|
hasRequiredLodash_isequal = 1;
|
|
62
|
-
(function (module, exports) {
|
|
62
|
+
(function (module, exports$1) {
|
|
63
63
|
/** Used as the size to enable large array optimizations. */
|
|
64
64
|
var LARGE_ARRAY_SIZE = 200;
|
|
65
65
|
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
146
146
|
|
|
147
147
|
/** Detect free variable `exports`. */
|
|
148
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
148
|
+
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
149
149
|
|
|
150
150
|
/** Detect free variable `module`. */
|
|
151
151
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -2115,7 +2115,7 @@
|
|
|
2115
2115
|
function requireRandomColor () {
|
|
2116
2116
|
if (hasRequiredRandomColor) return randomColor$1.exports;
|
|
2117
2117
|
hasRequiredRandomColor = 1;
|
|
2118
|
-
(function (module, exports) {
|
|
2118
|
+
(function (module, exports$1) {
|
|
2119
2119
|
(function(root, factory) {
|
|
2120
2120
|
|
|
2121
2121
|
// Support CommonJS
|
|
@@ -2124,11 +2124,11 @@
|
|
|
2124
2124
|
|
|
2125
2125
|
// Support NodeJS & Component, which allow module.exports to be a function
|
|
2126
2126
|
if (module && module.exports) {
|
|
2127
|
-
exports = module.exports = randomColor;
|
|
2127
|
+
exports$1 = module.exports = randomColor;
|
|
2128
2128
|
}
|
|
2129
2129
|
|
|
2130
2130
|
// Support CommonJS 1.1.1 spec
|
|
2131
|
-
exports.randomColor = randomColor;
|
|
2131
|
+
exports$1.randomColor = randomColor;
|
|
2132
2132
|
|
|
2133
2133
|
// Support AMD
|
|
2134
2134
|
}
|
|
@@ -2860,18 +2860,18 @@
|
|
|
2860
2860
|
this.sources[sourceId] = vectorLayerIds;
|
|
2861
2861
|
}
|
|
2862
2862
|
else {
|
|
2863
|
-
throw new Error("Missing
|
|
2863
|
+
throw new Error("Missing vector_layers in source: " + sourceId);
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
catch (_b) {
|
|
2867
2867
|
console.warn("Unable to retrieve tileJSON from " + style.sources[sourceId].url + " using style's layers");
|
|
2868
2868
|
for (const layer of style.layers) {
|
|
2869
2869
|
if ('source-layer' in layer && layer['source-layer']) {
|
|
2870
|
-
const
|
|
2870
|
+
const layerId = layer['source-layer'];
|
|
2871
2871
|
if (!this.sources[sourceId]) {
|
|
2872
2872
|
this.sources[sourceId] = [];
|
|
2873
2873
|
}
|
|
2874
|
-
this.sources[sourceId].push(
|
|
2874
|
+
this.sources[sourceId].push(layerId);
|
|
2875
2875
|
}
|
|
2876
2876
|
}
|
|
2877
2877
|
}
|
|
@@ -2881,6 +2881,10 @@
|
|
|
2881
2881
|
if (mapStyleSourcesNames.indexOf(sourceId) === -1) {
|
|
2882
2882
|
delete this.sources[sourceId];
|
|
2883
2883
|
}
|
|
2884
|
+
else {
|
|
2885
|
+
// uniqify the list of layer names
|
|
2886
|
+
this.sources[sourceId] = [...new Set(this.sources[sourceId])];
|
|
2887
|
+
}
|
|
2884
2888
|
}
|
|
2885
2889
|
});
|
|
2886
2890
|
}
|