* add elevation info in preview
* fix various issues
- pmtile coordinates
- pixel calculation
- swapped lat / long
- allow tileSize to be configured
- allow any zoom for coordinates
* apply linter changes
* remove not used entry
* drop baseUrl in favor of public_url
* fix map not using full body
* remove bounds check for coordinates
---------
Co-authored-by: Miko <miko@none>
* add terrain preview and elevation link
* add elevation api for terrain tiles
* add documentation for elevation api
* applied lint:js:fix
* Add `test-docker` for test execution in docker build environment
* Fix too greedy router expression
* Add pmtile support
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
* add encoding param to pmtile section
* add map controls
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
* remove not needed check
* fix possible float usage in thumbnail url
* update readme for encoding option
* add better link name
---------
Co-authored-by: Miko <miko@none>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
* handle local geojson files in styles and rendered tiles
- use 'file://' as indicator for local files
- add directory as default directory
- serve local files at
- add documentation for static file serving
- add some minor fixes (icon directory, directory checking, decodeURIComponent, extend error message)
* Update .gitignore
---------
Co-authored-by: Miko <miko@home-laptop.fritz.box>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
* feat: replace formatQuality with formatOptions in config file
formatQuality is more flexible and allows configuration of more than just quality for all formats.
JPEG and WebP still have only their quality configurable.
PNG has all the configuration options from the sharp library exposed.
Signed-off-by: Nathan Reed <nathreed@gmail.com>
* feat: update docs for new formatOptions
Signed-off-by: Nathan Reed <nathreed@gmail.com>
* feat: allow deprecated formatQuality with logged warning
Signed-off-by: Nathan Reed <nathreed@gmail.com>
---------
Signed-off-by: Nathan Reed <nathreed@gmail.com>
* feat: use `@jsse/pbfont` instead of `@mapbox/glyph-pbf-composite`
Signed-off-by: prashis <prashis.meshram@hotmail.com>
* refactor: use named import for `@jsse/pbfont`
Signed-off-by: prashis <prashis.meshram@hotmail.com>
---------
Signed-off-by: prashis <prashis.meshram@hotmail.com>
* fix: allow sprite array in styles
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: add 'sprite/' to generated path
So it doesn't conflict with style json url
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: allow old sprite endpoints to work
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: add multi-sprite name to endpoint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: duplicate styleJSON.sprite
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: try to fix some codeql errors
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: try to fix some codeql errors
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: try to fix some codeql errors
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: try to fix some codeql errors
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: try to fix some codeql errors
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: ci sprite issue
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: remove console.log's
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: use sprite id instead of name
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: add suggestions
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: remove unneeded array check
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: don't force multi-sprites in style
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: move fixUrl and allowedOptions to utils
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: add test for default sprite
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: acalcutt <acalcutt@techidiots.net>
---------
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Signed-off-by: acalcutt <acalcutt@techidiots.net>
* fix: tilesize should not be added to data endpoint
* fix: make tilesize and option of addtilejson urls
* docs: update tilesize info for index.json and rendered.json
* fix: lint
* fix: try to add attribution to wmts
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: 512 tiles being wrong level for maplibre-js
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: revert wmts zoom level hack
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: test tileMargin
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: remove broken mercator_512 change
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: put back mercator
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* Revert "fix: try to add attribution to wmts"
This reverts commit b8d858f2c6d6354ea54a7fe18d08bb50d8f28219.
* fix: put back if
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: semicolon
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: semicolon
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: center without mercator_512
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: put back const
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: text
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
---------
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* test: using 512px rendered tiles
Based on https://github.com/maptiler/tileserver-gl/pull/495
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: use static renderer at zoom 0
renderer is not able to change the size of tile to more than 512px in tile mode
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* Add support for 512 sized raster tiles (#1)
* Enable setting tilesize for raster tiles
* Serve correct endpoint for raster tiles
* Add 256 & 512 sized raster layers to wmts getCapabilities document
* Update wmts getCapabilities tileMatrixSets
* Add rendered tiles format for getTileUrls method
* Update endpoints documentation
* Add and fix tiles_rendered tests
* fix: formatting
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: corrent bad merge
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: if tile size is undefined don't add it
needed for data endpoint right now
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: set tile size in raster endpoints to 512
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: add semicolon
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: test z1 512px file that actually exists
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: make tileSize optional
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: cleaner if statement
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: update tileSize to show as optional
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: allow tile size in data url
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: remove unneeded tileSize
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: set data as 256 tileSize for consistency
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: add note about optional data tileSize
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* Revert "fix: remove unneeded tileSize"
This reverts commit a4583161bf53653d65a4606c407ba9b5249d1061.
* fix: allow tile size to be set at json endpoints
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: set default endpoint tilesizes
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: don't use tilesize one data endpoint
It doesn't do anything
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: default style endpoint to undefined
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: zoom 0 workaround
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* Revert "fix: zoom 0 workaround"
This reverts commit 0f3bbd765c9c151016cec66768675f990676c8b3.
* fix: limit min zoom to 1 in viewer
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: put back orig string
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: add optional tilesize to TileJSON
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: cleanup thumbnails
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: default undefined like other data endpoints
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: move data xyz_link
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: remove console.log
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* chore: update version
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: update path
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: join error
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: revert path change
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
---------
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Petteri Pesonen <teemu.p.pesonen@gmail.com>
* chore: fix crash on ARM during rendering
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: remove useless comment
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
---------
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Promise code never worked: listFonts did not wait for fs.stat() to resolve().
This was not evident because late results were still used.
A recent PR made it worse: late results are now ignored.
This manifested for styles with missing fonts, no fallback could be used.
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Maplibre-native outputs premultiplied pixels values. The sharp library did not
support it so we added code to cancel the alpha premultiplication.
Note that this can only visible onr raster tiles (and probably static maps).
The sharp library now supports premultiplied pixels with the right config.
Let's use it: it should be faster and easie to maintain.
Feature announced here:
https://github.com/lovell/sharp/issues/1599#issuecomment-837004081
Feature developped here by @mnutt:
https://github.com/lovell/sharp/pull/2685
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: make sure error exit codes of tests are returned
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: replace the last 'var' with 'const'
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: extract duplicated font listing
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: extract rendering functions to a new file
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: move nested respondImage() function to top level
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: simplify respondImage() args
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: fix typo in rendeAttribution
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
---------
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
Root cause: modified regex in #1002 caused URLs to be broken.
Fixed by reverting previous regexes.
Tests:
* Confirmed by building and running locally with formerly breaking config.json and style json.
* Run tests via Dockerfile_test
Adds pmtiles support to TileServer-GL
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Signed-off-by: Michael Nutt <michael@nuttnet.net>
Co-authored-by: Michael Nutt <michael@nuttnet.net>
* chore: cleanup useless decodeURIComponent() calls
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: try to fix CodeQL failure "Polynomial regular expression"
Fix 1:
\d\.?\d* can backtrack catastrophically
\d(\.\d*)? is safer
Fix 2:
Useless parenthesis around "enc:"
Fix 3:
The httpTester regex was misleading. It did not really check for "http".
Simplified to show its true meaning. The behaviour should not have changed.
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: try to optimize the regex further, to fix CodeQL failure
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* chore: consistency between previous changes, docs, and serve_style.js
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
---------
Signed-off-by: Martin d'Allens <martin.dallens@liberty-rider.com>
* fix: incorrect polyline decoding
Don't split static image encoded path on pipe or comma
Signed-off-by: boldtrn <boldtrn@gmail.com>
* fix: still allow other parameters other than enc:
That way we can still style individual paths
Signed-off-by: boldtrn <boldtrn@gmail.com>
* chore: lint
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* chore: lint + comment
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: try to clarify path information
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: stroke color not working unless path is specified
i found this issue testing encoded paths. If width is not specifed, stroke color does not work
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
* docs: show different options
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
---------
Signed-off-by: boldtrn <boldtrn@gmail.com>
Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
Co-authored-by: Andrew Calcutt <acalcutt@techidiots.net>
* fix: don't crash the server on processing issues
Use a try/catch for async functions
Signed-off-by: boldtrn <boldtrn@gmail.com>
* chore: run lint
Signed-off-by: boldtrn <boldtrn@gmail.com>
---------
Signed-off-by: boldtrn <boldtrn@gmail.com>
* fix: allow to style each individual path for static images
Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>
* chore: cleanup drawPath render function
Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>
---------
Signed-off-by: Samuel Leihkamm <s.leihkamm@gmx.com>
* Use center and zoom from style json as default center for tilejson of rendered maps
* Round zoom as style spec allows fractional zooms while tilejson spec does not
* Handle SIGTERM
Resolve#781
* Add `Caught signal ...` messages
Container log when sending a `SIGHUP` signal and then a `SIGTERM` signal using
`docker kill --signal ...` :
```
Starting tileserver-gl v4.4.8
[INFO] Automatically creating config file for zurich_switzerland.mbtiles
[INFO] Only a basic preview style will be used.
[INFO] See documentation to learn how to create config.json file.
Run with --verbose to see the config file here.
Starting server
Listening at http://[::]:8080/
Startup complete
Caught signal SIGHUP, refreshing
Stopping server and reloading config
Starting server
Listening at http://[::]:8080/
Startup complete
Caught signal SIGTERM, stopping gracefully
```
Note that the numeric signal values, as used in the shell version, were
replaced by signal names, as used in nodeJS.
* run 'npm run lint:js:fix'
---------
Co-authored-by: acalcutt <acalcutt@techidiots.net>