tileserver-gl-light 5.5.0-pre.1 → 5.5.0-pre.11
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 +51 -34
- package/docs/config.rst +52 -11
- package/docs/endpoints.rst +12 -2
- package/docs/installation.rst +6 -6
- package/docs/usage.rst +26 -0
- package/package.json +15 -15
- package/public/resources/elevation-control.js +92 -21
- package/public/resources/maplibre-gl-inspect.js +2827 -2770
- package/public/resources/maplibre-gl-inspect.js.map +1 -1
- package/public/resources/maplibre-gl.css +1 -1
- package/public/resources/maplibre-gl.js +4 -4
- package/public/resources/maplibre-gl.js.map +1 -1
- package/src/main.js +31 -20
- package/src/pmtiles_adapter.js +104 -45
- package/src/promises.js +1 -1
- package/src/render.js +270 -93
- package/src/serve_data.js +266 -90
- package/src/serve_font.js +2 -2
- package/src/serve_light.js +2 -4
- package/src/serve_rendered.js +445 -236
- package/src/serve_style.js +29 -8
- package/src/server.js +115 -60
- package/src/utils.js +47 -20
- package/test/elevation.js +513 -0
- package/test/fixtures/visual/encoded-path-auto.png +0 -0
- package/test/fixtures/visual/linecap-linejoin-bevel-square.png +0 -0
- package/test/fixtures/visual/linecap-linejoin-round-round.png +0 -0
- package/test/fixtures/visual/path-auto.png +0 -0
- package/test/fixtures/visual/static-bbox.png +0 -0
- package/test/fixtures/visual/static-bearing-pitch.png +0 -0
- package/test/fixtures/visual/static-bearing.png +0 -0
- package/test/fixtures/visual/static-border-global.png +0 -0
- package/test/fixtures/visual/static-lat-lng.png +0 -0
- package/test/fixtures/visual/static-markers.png +0 -0
- package/test/fixtures/visual/static-multiple-paths.png +0 -0
- package/test/fixtures/visual/static-path-border-isolated.png +0 -0
- package/test/fixtures/visual/static-path-border-stroke.png +0 -0
- package/test/fixtures/visual/static-path-latlng.png +0 -0
- package/test/fixtures/visual/static-pixel-ratio-2x.png +0 -0
- package/test/static_images.js +241 -0
- package/test/tiles_data.js +1 -1
- package/test/utils/create_terrain_mbtiles.js +124 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,55 +1,72 @@
|
|
|
1
1
|
# tileserver-gl changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
## master
|
|
4
|
+
### ✨ Features and improvements
|
|
5
|
+
- _...Add new stuff here..._
|
|
6
|
+
|
|
7
|
+
### 🐞 Bug fixes
|
|
8
|
+
- _...Add new stuff here..._
|
|
9
|
+
|
|
10
|
+
## 5.5.0-pre.11
|
|
11
|
+
- Add S3 support for PMTiles with multiple AWS credential profiles (https://github.com/maptiler/tileserver-gl/pull/1779) by @acalcutt
|
|
12
|
+
- Create .aws directory passthrough folder in Dockerfile (https://github.com/maptiler/tileserver-gl/pull/1784) by @acalcutt
|
|
13
|
+
- Update eslint to v9 (https://github.com/maptiler/tileserver-gl/pull/1473) by @acalcutt
|
|
14
|
+
- Fix Renderer Crashes from Failed Fetches (https://github.com/maptiler/tileserver-gl/pull/1798) by @acalcutt
|
|
15
|
+
- Add Visual Regression Tests for Static Image Overlays (https://github.com/maptiler/tileserver-gl/pull/1792) by @acalcutt
|
|
16
|
+
- Fix S3 URL parsing for nested paths in AWS buckets (https://github.com/maptiler/tileserver-gl/pull/1819) by @acalcutt
|
|
17
|
+
- Fix Renderer Crashes and Memory Leak (https://github.com/maptiler/tileserver-gl/pull/1825) by @acalcutt
|
|
18
|
+
- Fix loading local data sources (PMTiles/MBTiles) specified in style (https://github.com/maptiler/tileserver-gl/pull/1855) by @acalcutt
|
|
19
|
+
- **BREAKING**: Change 'sparse' option default based on tile format - vector tiles (pbf) default to false (204), raster tiles default to true (404 for overzoom) (https://github.com/maptiler/tileserver-gl/pull/1855) by @acalcutt
|
|
20
|
+
- Migrate NPM publishing to trusted publishing (OIDC) ([#1872](https://github.com/maptiler/tileserver-gl/pull/1872)) (by [app/copilot-swe-agent](https://github.com/app/copilot-swe-agent)
|
|
21
|
+
- Update Maplibre-Native to v6.3.0. Note that the linux version now requires Ubuntu 24.04 to match the maplibre-native binary. (https://github.com/maptiler/tileserver-gl/pull/1907) by @acalcutt @dependabot
|
|
22
|
+
- Fix get elevation may return data from wrong point (https://github.com/maptiler/tileserver-gl/pull/1860) by @russellporter @acalcutt
|
|
6
23
|
|
|
7
24
|
## 5.4.0
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
- 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
|
|
26
|
+
- Use jemalloc as memory allocator in the docker image (https://github.com/maptiler/tileserver-gl/pull/1574) by @MichielMortier
|
|
27
|
+
- Rasters: Add tileSize to TileJSON (https://github.com/maptiler/tileserver-gl/pull/1559) by @roblabs
|
|
28
|
+
- Allow a 'sparse' option per data source (https://github.com/maptiler/tileserver-gl/pull/1558) by @acalcutt
|
|
29
|
+
- Updates Maplibre-gl-js to v5.6.2 and adds color-relief support (note: this is not yet supported by maplibre-native) (https://github.com/maptiler/tileserver-gl/pull/1591)
|
|
30
|
+
- Fix getPublicUrl to handle relative and absolute URLs (https://github.com/maptiler/tileserver-gl/pull/1472) by @Monnte
|
|
31
|
+
- Workaround for 'hillshade-method' not yet being suported in maplibre-native (https://github.com/maptiler/tileserver-gl/pull/1620) by @acalcutt
|
|
32
|
+
- Updates Maplibre-native to v6.2.0. This should fix the macos metal support in Issue: (https://github.com/maptiler/tileserver-gl/issues/1402)
|
|
16
33
|
|
|
17
34
|
## 5.3.0
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
35
|
+
- Fix - Include public\resources js files on npm publish by specifying included files in package.json (https://github.com/maptiler/tileserver-gl/pull/1490) by @acalcutt
|
|
36
|
+
- Fix - Various Updates and Fix RTL Plugin Load (https://github.com/maptiler/tileserver-gl/pull/1489) by @okimiko
|
|
37
|
+
- Updates Maplibre-gl-js to v5 and adds globe support.
|
|
21
38
|
|
|
22
39
|
## 5.2.1
|
|
23
|
-
|
|
40
|
+
- Fix invalid Delete of 'prepare' Script required for Light Build (https://github.com/maptiler/tileserver-gl/pull/1489) by @okimiko
|
|
24
41
|
|
|
25
42
|
|
|
26
43
|
## 5.2.0
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
- Use npm packages for public/resources (https://github.com/maptiler/tileserver-gl/pull/1427) by @okimiko
|
|
45
|
+
- use ttf files of googlefonts/opensans (https://github.com/maptiler/tileserver-gl/pull/1447) by @okimiko
|
|
46
|
+
- Limit Elevation Lat/Long Output Length (https://github.com/maptiler/tileserver-gl/pull/1457) by @okimiko
|
|
47
|
+
- Fetch style from url (https://github.com/maptiler/tileserver-gl/pull/1462) by @YoelRidgway
|
|
48
|
+
- fix: memory leak on SIGHUP (https://github.com/maptiler/tileserver-gl/pull/1455) by @okimiko
|
|
49
|
+
- fix: resolves Unimplemented type: 3 error for geojson format (https://github.com/maptiler/tileserver-gl/pull/1465) by @rjdjohnston
|
|
50
|
+
- fix: Test light version in ct workflow - fix sqlite build in light (https://github.com/maptiler/tileserver-gl/pull/1477) by @acalcutt
|
|
51
|
+
- fix: light version docker entrypoint permissions (https://github.com/maptiler/tileserver-gl/pull/1478) by @acalcutt
|
|
35
52
|
|
|
36
53
|
## 5.1.3
|
|
37
|
-
|
|
54
|
+
- Fix SIGHUP (broken since 5.1.x) (https://github.com/maptiler/tileserver-gl/pull/1452) by @okimiko
|
|
38
55
|
|
|
39
56
|
## 5.1.2
|
|
40
|
-
|
|
57
|
+
- Fix broken light (invalid use of heavy dependencies) (https://github.com/maptiler/tileserver-gl/pull/1449) by @okimiko
|
|
41
58
|
|
|
42
59
|
## 5.1.1
|
|
43
|
-
|
|
60
|
+
- Fix wrong node version in Docker image (https://github.com/maptiler/tileserver-gl/pull/1442) by @acalcutt
|
|
44
61
|
|
|
45
62
|
## 5.1.0
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
- Update recommended node to v22 + Update docker images to use node 22 (https://github.com/maptiler/tileserver-gl/pull/1438) by @acalcutt
|
|
64
|
+
- Upgrade Express to v5 + Canvas to v3 + code cleanup (https://github.com/maptiler/tileserver-gl/pull/1429) by @acalcutt
|
|
65
|
+
- Terrain Preview and simple Elevation Query (https://github.com/maptiler/tileserver-gl/pull/1425 and https://github.com/maptiler/tileserver-gl/pull/1432) by @okimiko
|
|
66
|
+
- add progressive rendering option for static jpeg images (#1397) by @samuel-git
|
|
50
67
|
|
|
51
68
|
## 5.0.0
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
- Update Maplibre-Native to [v6.0.0](https://github.com/maplibre/maplibre-native/releases/tag/node-v6.0.0) release by @acalcutt in https://github.com/maptiler/tileserver-gl/pull/1376 and @dependabot in https://github.com/maptiler/tileserver-gl/pull/1381
|
|
70
|
+
- This first release that use Metal for rendering instead of OpenGL (ES) for macOS.
|
|
71
|
+
- This the first release that uses OpenGL (ES) 3.0 on Windows and Linux
|
|
72
|
+
- Note: Windows users may need to update their [c++ redistributable ](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) for maplibre-native v6.0.0
|
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.
|
|
@@ -311,6 +312,23 @@ Here are the available options for each data source:
|
|
|
311
312
|
If not specified, uses ``AWS_REGION`` environment variable or defaults to ``us-east-1``.
|
|
312
313
|
Optional, only applicable to PMTiles sources using S3 URLs.
|
|
313
314
|
|
|
315
|
+
``s3UrlFormat`` (string)
|
|
316
|
+
Specifies how to interpret the S3 URL format.
|
|
317
|
+
|
|
318
|
+
Allowed values:
|
|
319
|
+
|
|
320
|
+
* ``aws`` - Interpret as AWS S3 (``s3://bucket/path/file.pmtiles``)
|
|
321
|
+
* ``custom`` - Interpret as custom S3 endpoint (``s3://endpoint/bucket/path/file.pmtiles``)
|
|
322
|
+
* Not specified (default) - Auto-detect based on URL pattern
|
|
323
|
+
|
|
324
|
+
Can be specified in the URL using ``?s3UrlFormat=aws`` or in the configuration.
|
|
325
|
+
If both are specified, the configuration value takes precedence.
|
|
326
|
+
|
|
327
|
+
Optional, only applicable to PMTiles sources using S3 URLs.
|
|
328
|
+
|
|
329
|
+
.. note::
|
|
330
|
+
By default, URLs with dots in the first segment (e.g., ``s3://storage.example.com/bucket/file.pmtiles``) are treated as custom endpoints, while URLs without dots are treated as AWS S3. Use ``s3UrlFormat: "aws"`` if your AWS bucket name contains dots.
|
|
331
|
+
|
|
314
332
|
.. note::
|
|
315
333
|
These configuration options will be overridden by metadata in the MBTiles or PMTiles file. if corresponding properties exist in the file's metadata, you do not need to specify them in the data configuration.
|
|
316
334
|
|
|
@@ -445,6 +463,17 @@ Precedence order (highest to lowest): Configuration property ``s3Region``, URL p
|
|
|
445
463
|
|
|
446
464
|
Precedence order (highest to lowest): Configuration property ``requestPayer``, URL parameter ``?requestPayer=true``, Default: ``false``.
|
|
447
465
|
|
|
466
|
+
*S3UrlFormat* - Specifies how to interpret S3 URLs::
|
|
467
|
+
|
|
468
|
+
# URL parameter
|
|
469
|
+
"pmtiles": "s3://my.bucket.name/tiles.pmtiles?s3UrlFormat=aws"
|
|
470
|
+
|
|
471
|
+
# Configuration property
|
|
472
|
+
"pmtiles": "s3://my.bucket.name/tiles.pmtiles",
|
|
473
|
+
"s3UrlFormat": "aws"
|
|
474
|
+
|
|
475
|
+
Precedence order (highest to lowest): Configuration property ``s3UrlFormat``, URL parameter ``?s3UrlFormat=...``, Auto-detection.
|
|
476
|
+
|
|
448
477
|
**Complete Configuration Examples:**
|
|
449
478
|
|
|
450
479
|
Using URL parameters::
|
|
@@ -453,6 +482,9 @@ Using URL parameters::
|
|
|
453
482
|
"us-west-tiles": {
|
|
454
483
|
"pmtiles": "s3://prod-bucket/tiles.pmtiles?profile=production®ion=us-west-2"
|
|
455
484
|
},
|
|
485
|
+
"dotted-bucket-name": {
|
|
486
|
+
"pmtiles": "s3://my.bucket.name/tiles.pmtiles?s3UrlFormat=aws®ion=us-east-1"
|
|
487
|
+
},
|
|
456
488
|
"eu-requester-pays": {
|
|
457
489
|
"pmtiles": "s3://bucket/tiles.pmtiles?profile=prod®ion=eu-central-1&requestPayer=true"
|
|
458
490
|
}
|
|
@@ -466,6 +498,11 @@ Using configuration properties (recommended)::
|
|
|
466
498
|
"s3Profile": "production",
|
|
467
499
|
"s3Region": "us-west-2"
|
|
468
500
|
},
|
|
501
|
+
"dotted-bucket-name": {
|
|
502
|
+
"pmtiles": "s3://my.bucket.name/tiles.pmtiles",
|
|
503
|
+
"s3UrlFormat": "aws",
|
|
504
|
+
"s3Region": "us-east-1"
|
|
505
|
+
},
|
|
469
506
|
"eu-requester-pays": {
|
|
470
507
|
"pmtiles": "s3://bucket/tiles.pmtiles",
|
|
471
508
|
"s3Profile": "production",
|
|
@@ -476,13 +513,17 @@ Using configuration properties (recommended)::
|
|
|
476
513
|
|
|
477
514
|
**Using S3 in Style JSON Sources:**
|
|
478
515
|
|
|
479
|
-
When referencing S3 sources from within a style JSON file, use the ``pmtiles://`` prefix with S3 URLs. You can
|
|
516
|
+
When referencing S3 sources from within a style JSON file, use the ``pmtiles://`` prefix with S3 URLs. You can specify profile, region, requestPayer, and s3UrlFormat using URL query parameters (configuration properties are not available in style JSON)::
|
|
480
517
|
|
|
481
518
|
"sources": {
|
|
482
519
|
"aws-tiles": {
|
|
483
520
|
"url": "pmtiles://s3://my-bucket/tiles.pmtiles?profile=production",
|
|
484
521
|
"type": "vector"
|
|
485
522
|
},
|
|
523
|
+
"dotted-bucket": {
|
|
524
|
+
"url": "pmtiles://s3://my.bucket.name/tiles.pmtiles?s3UrlFormat=aws",
|
|
525
|
+
"type": "vector"
|
|
526
|
+
},
|
|
486
527
|
"spaces-tiles": {
|
|
487
528
|
"url": "pmtiles://s3://example-storage.com/my-bucket/tiles.pmtiles?region=nyc3",
|
|
488
529
|
"type": "vector"
|
package/docs/endpoints.rst
CHANGED
|
@@ -100,13 +100,23 @@ Source data
|
|
|
100
100
|
|
|
101
101
|
* TileJSON at ``/data/{id}.json``
|
|
102
102
|
|
|
103
|
-
* If terrain mbtile data is served and ``encoding`` is configured (see config) the elevation can be queried
|
|
103
|
+
* If terrain mbtile data is served and ``encoding`` is configured (see config) the elevation can be queried
|
|
104
104
|
|
|
105
105
|
* by ``/data/{id}/elevation/{z}/{x}/{y}`` for the tile
|
|
106
106
|
|
|
107
107
|
* or ``/data/{id}/elevation/{z}/{long}/{lat}`` for the coordinate
|
|
108
108
|
|
|
109
|
-
* the result will be a json object like ``{"z":7,"x":68,"y":45,"
|
|
109
|
+
* the result will be a json object like ``{"z":7,"x":68,"y":45,"long":46.04798,"lat":11.84069,"elevation":1602,"pixelX":128,"pixelY":256}``
|
|
110
|
+
|
|
111
|
+
* for batch requests, POST to ``/data/{id}/elevation`` with a JSON body:
|
|
112
|
+
|
|
113
|
+
* Request: ``{"points": [{"lon": 45.5, "lat": 45.5, "z": 1}, ...]}``
|
|
114
|
+
* Response: ``[500, 200, null, ...]`` - array of elevations (or null if no data) in the same order as input
|
|
115
|
+
|
|
116
|
+
* for batch requests, POST to ``/data/{id}/elevation`` with a JSON body:
|
|
117
|
+
|
|
118
|
+
* Request: ``{"points": [{"lon": 45.5, "lat": 45.5, "z": 1}, ...]}``
|
|
119
|
+
* Response: ``[500, 200, null, ...]`` - array of elevations (or null if no data) in the same order as input
|
|
110
120
|
|
|
111
121
|
* The elevation api is not available in the ``tileserver-gl-light`` version.
|
|
112
122
|
|
package/docs/installation.rst
CHANGED
|
@@ -21,11 +21,11 @@ npm is supported on the following platforms with `Native Dependencies <#id1>`_ i
|
|
|
21
21
|
|
|
22
22
|
- Operating systems:
|
|
23
23
|
|
|
24
|
-
- Ubuntu
|
|
25
|
-
- macOS
|
|
24
|
+
- Ubuntu 24.04 (x64/arm64)
|
|
25
|
+
- macOS 15 (x64/arm64)
|
|
26
26
|
- Windows (x64)
|
|
27
27
|
|
|
28
|
-
- Node.js
|
|
28
|
+
- Node.js 20,22,24
|
|
29
29
|
|
|
30
30
|
Install globally from npmjs.
|
|
31
31
|
------------------------------
|
|
@@ -46,11 +46,11 @@ Install locally from source
|
|
|
46
46
|
Native dependencies
|
|
47
47
|
-------------------
|
|
48
48
|
|
|
49
|
-
Ubuntu
|
|
49
|
+
Ubuntu 24.04 (x64/arm64)
|
|
50
50
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
51
|
-
- apt install build-essential pkg-config xvfb libglfw3-dev libuv1-dev libjpeg-turbo8
|
|
51
|
+
- apt install build-essential python3-setuptools pkg-config xvfb libglfw3-dev libuv1-dev libjpeg-turbo8 libicu-dev libcairo2-dev libpango1.0-dev libpng-dev libjpeg-dev libgif-dev librsvg2-dev librsvg2-dev libcurl4-openssl-dev libpixman-1-dev
|
|
52
52
|
|
|
53
|
-
MacOS
|
|
53
|
+
MacOS 15 (x64/arm64)
|
|
54
54
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
55
55
|
- brew install pkg-config cairo pango libpng jpeg giflib librsvg harfbuzz
|
|
56
56
|
|
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
|
|
@@ -64,6 +65,9 @@ The `--file` option supports multiple source types:
|
|
|
64
65
|
# Requester-pays bucket
|
|
65
66
|
tileserver-gl --file "s3://bucket/tiles.pmtiles?requestPayer=true"
|
|
66
67
|
|
|
68
|
+
# Bucket name with dots (force AWS S3 interpretation)
|
|
69
|
+
tileserver-gl --file "s3://my.bucket.name/tiles.pmtiles?s3UrlFormat=aws"
|
|
70
|
+
|
|
67
71
|
# All options combined
|
|
68
72
|
tileserver-gl --file "s3://bucket/tiles.pmtiles?profile=prod®ion=us-west-2&requestPayer=true"
|
|
69
73
|
|
|
@@ -82,6 +86,8 @@ You can also use `pmtiles://` or `mbtiles://` prefixes to explicitly specify the
|
|
|
82
86
|
.. note::
|
|
83
87
|
For S3 sources, AWS credentials must be configured via environment variables, AWS credentials file (`~/.aws/credentials` on Linux/macOS or `C:\Users\USERNAME\.aws\credentials` on Windows), or IAM roles.
|
|
84
88
|
|
|
89
|
+
The `s3UrlFormat` parameter can be set to `aws` or `custom` to override auto-detection when needed (e.g., for AWS bucket names containing dots).
|
|
90
|
+
|
|
85
91
|
**When using Docker**, the host credentials file can be mounted to the container's user home directory:
|
|
86
92
|
|
|
87
93
|
::
|
|
@@ -96,6 +102,26 @@ Default preview style and configuration
|
|
|
96
102
|
- If no configuration file is specified, a default preview style (compatible with openmaptiles) is used.
|
|
97
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)
|
|
98
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
|
+
|
|
99
125
|
Reloading the configuration
|
|
100
126
|
======
|
|
101
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.11",
|
|
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",
|
|
@@ -24,46 +24,46 @@
|
|
|
24
24
|
"copy:leaflet-hash": "copyfiles -EVf node_modules/leaflet-hash/leaflet-hash.js public/resources/",
|
|
25
25
|
"test": "mocha test/**.js --timeout 10000 --exit",
|
|
26
26
|
"test-docker": "xvfb-run npm test",
|
|
27
|
+
"test:visual:generate": "cross-env GENERATE_FIXTURES=true mocha test/setup.js test/static_images.js --timeout 10000 --exit",
|
|
27
28
|
"lint:yml": "yamllint --schema=CORE_SCHEMA *.{yml,yaml}",
|
|
28
29
|
"lint:js": "npm run lint:eslint && npm run lint:prettier",
|
|
29
30
|
"lint:js:fix": "npm run lint:eslint:fix && npm run lint:prettier:fix",
|
|
30
|
-
"lint:eslint": "eslint \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-
|
|
31
|
-
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-
|
|
31
|
+
"lint:eslint": "eslint \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-pattern '.gitignore'",
|
|
32
|
+
"lint:eslint:fix": "eslint --fix \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs}\" --ignore-pattern '.gitignore'",
|
|
32
33
|
"lint:prettier": "prettier --check \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
|
33
34
|
"lint:prettier:fix": "prettier --write \"{,!(node_modules|dist|static|public)/**/}*.{js,ts,cjs,mjs,json}\" --ignore-path .gitignore",
|
|
34
35
|
"docker": "docker build . && docker run --rm -i -p 8080:8080 $(docker build -q .)"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@aws-sdk/client-s3": "^3.
|
|
38
|
+
"@aws-sdk/client-s3": "^3.958.0",
|
|
38
39
|
"@jsse/pbfont": "^0.3.0",
|
|
39
40
|
"@mapbox/mapbox-gl-rtl-text": "0.3.0",
|
|
40
41
|
"@mapbox/mbtiles": "0.12.1",
|
|
41
42
|
"@mapbox/polyline": "^1.2.1",
|
|
42
43
|
"@mapbox/sphericalmercator": "2.0.2",
|
|
43
44
|
"@mapbox/vector-tile": "2.0.4",
|
|
44
|
-
"@maplibre/maplibre-gl-inspect": "1.
|
|
45
|
-
"@maplibre/maplibre-gl-style-spec": "24.
|
|
45
|
+
"@maplibre/maplibre-gl-inspect": "1.8.2",
|
|
46
|
+
"@maplibre/maplibre-gl-style-spec": "24.4.1",
|
|
46
47
|
"@sindresorhus/fnv1a": "3.1.0",
|
|
47
48
|
"advanced-pool": "0.3.3",
|
|
48
|
-
"
|
|
49
|
-
"chokidar": "4.0.3",
|
|
49
|
+
"chokidar": "5.0.0",
|
|
50
50
|
"clone": "2.1.2",
|
|
51
|
-
"color": "5.0.
|
|
51
|
+
"color": "5.0.3",
|
|
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.15.0",
|
|
61
61
|
"morgan": "1.10.1",
|
|
62
62
|
"pbf": "4.0.1",
|
|
63
|
-
"pmtiles": "4.3.
|
|
64
|
-
"proj4": "2.
|
|
63
|
+
"pmtiles": "4.3.2",
|
|
64
|
+
"proj4": "2.20.2",
|
|
65
65
|
"sanitize-filename": "1.6.3",
|
|
66
|
-
"semver": "^7.7.
|
|
66
|
+
"semver": "^7.7.3",
|
|
67
67
|
"tileserver-gl-styles": "2.0.0"
|
|
68
68
|
},
|
|
69
69
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"node": ">= 14.15.0"
|
|
78
78
|
},
|
|
79
79
|
"repository": {
|
|
80
|
-
"url": "
|
|
80
|
+
"url": "https://github.com/maptiler/tileserver-gl",
|
|
81
81
|
"type": "git"
|
|
82
82
|
},
|
|
83
83
|
"bugs": {
|
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
class ElevationInfoControl {
|
|
2
2
|
constructor(options) {
|
|
3
3
|
this.url = options["url"];
|
|
4
|
+
this.originalTerrain = null;
|
|
5
|
+
this.suppressDEMErrors = true;
|
|
6
|
+
this.setupErrorHandler();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
setupErrorHandler() {
|
|
10
|
+
// Suppress DEM out-of-range errors that occur when placing markers at coordinates outside DEM coverage
|
|
11
|
+
const originalHandler = window.onerror;
|
|
12
|
+
window.onerror = (msg, url, line, col, error) => {
|
|
13
|
+
if (error && error.message && error.message.includes('out of range source coordinates for DEM data')) {
|
|
14
|
+
console.warn("DEM coordinate out of range (suppressed):", error);
|
|
15
|
+
return true; // Suppress the error
|
|
16
|
+
}
|
|
17
|
+
// Call original handler if it exists
|
|
18
|
+
if (typeof originalHandler === 'function') {
|
|
19
|
+
return originalHandler(msg, url, line, col, error);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Also suppress promise rejections for DEM errors
|
|
24
|
+
const originalHandler2 = window.onunhandledrejection;
|
|
25
|
+
window.onunhandledrejection = (event) => {
|
|
26
|
+
if (event.reason && event.reason.message && event.reason.message.includes('out of range source coordinates for DEM data')) {
|
|
27
|
+
console.warn("DEM coordinate out of range (suppressed):", event.reason);
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
// Call original handler if it exists
|
|
32
|
+
if (typeof originalHandler2 === 'function') {
|
|
33
|
+
return originalHandler2(event);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
4
36
|
}
|
|
5
37
|
|
|
6
38
|
getDefaultPosition() {
|
|
@@ -10,6 +42,7 @@ class ElevationInfoControl {
|
|
|
10
42
|
|
|
11
43
|
onAdd(map) {
|
|
12
44
|
this.map = map;
|
|
45
|
+
this.originalTerrain = map.getTerrain();
|
|
13
46
|
this.controlContainer = document.createElement("div");
|
|
14
47
|
this.controlContainer.classList.add("maplibregl-ctrl");
|
|
15
48
|
this.controlContainer.classList.add("maplibregl-ctrl-group");
|
|
@@ -19,29 +52,58 @@ class ElevationInfoControl {
|
|
|
19
52
|
this.marker = new maplibregl.Marker();
|
|
20
53
|
|
|
21
54
|
map.on('click', (e) => {
|
|
55
|
+
if (!map.transform.isPointOnMapSurface(e.point)) {
|
|
56
|
+
this.controlContainer.textContent = "Elevation: Click on Globe";
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
22
60
|
var url = this.url;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
61
|
+
var lngLat = e.lngLat;
|
|
62
|
+
|
|
63
|
+
// Validate coordinates are within valid range
|
|
64
|
+
if (typeof lngLat !== 'object' || typeof lngLat.lng !== 'number' || typeof lngLat.lat !== 'number') {
|
|
65
|
+
this.controlContainer.textContent = "Elevation: Invalid coordinates";
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
28
68
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
var coord = {"z": Math.floor(map.getZoom()), "x": lngLat.lng.toFixed(7), "y": lngLat.lat.toFixed(7)};
|
|
70
|
+
|
|
71
|
+
for(var key in coord) {
|
|
72
|
+
url = url.replace(new RegExp('{'+ key +'}','g'), coord[key]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Place marker at clicked location
|
|
76
|
+
// Note: Terrain is disabled to prevent DEM errors with markers at out-of-bounds coordinates.
|
|
77
|
+
// The marker conflicts with the terrain system in MapLibre, so we keep terrain disabled.
|
|
78
|
+
const hadTerrain = this.map.getTerrain();
|
|
79
|
+
if (hadTerrain) {
|
|
80
|
+
this.map.setTerrain(null);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
if (this.marker) {
|
|
85
|
+
this.marker.remove();
|
|
40
86
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.
|
|
87
|
+
|
|
88
|
+
this.marker = new maplibregl.Marker();
|
|
89
|
+
this.marker.setLngLat({lng: lngLat.lng, lat: lngLat.lat});
|
|
90
|
+
this.marker.addTo(this.map);
|
|
91
|
+
} catch (_err) {
|
|
92
|
+
// If placement fails, continue without marker
|
|
93
|
+
console.error("Marker placement error:", _err);
|
|
44
94
|
}
|
|
95
|
+
// Terrain remains disabled to avoid repeated DEM errors from marker updates
|
|
96
|
+
|
|
97
|
+
let request = new XMLHttpRequest();
|
|
98
|
+
request.open("GET", url, true);
|
|
99
|
+
request.onload = () => {
|
|
100
|
+
if (request.status !== 200) {
|
|
101
|
+
this.controlContainer.textContent = "Elevation: No value";
|
|
102
|
+
} else {
|
|
103
|
+
this.controlContainer.textContent = `Elevation: ${JSON.parse(request.responseText).elevation} (${JSON.stringify(coord)})`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
request.send();
|
|
45
107
|
});
|
|
46
108
|
return this.controlContainer;
|
|
47
109
|
}
|
|
@@ -55,8 +117,17 @@ class ElevationInfoControl {
|
|
|
55
117
|
return;
|
|
56
118
|
}
|
|
57
119
|
this.controlContainer.parentNode.removeChild(this.controlContainer);
|
|
120
|
+
|
|
121
|
+
// Restore terrain if it was originally enabled
|
|
122
|
+
if (this.originalTerrain && !this.map.getTerrain()) {
|
|
123
|
+
this.map.setTerrain(this.originalTerrain);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (this.marker) {
|
|
127
|
+
this.marker.remove();
|
|
128
|
+
this.marker = undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
58
131
|
this.map = undefined;
|
|
59
|
-
this.marker.remove();
|
|
60
|
-
this.marker = undefined;
|
|
61
132
|
}
|
|
62
133
|
};
|