From 309d481117d3ec130b1c5fbe097ec483d57060cc Mon Sep 17 00:00:00 2001 From: David Weber | geOps Date: Fri, 16 Oct 2020 09:15:10 +0200 Subject: [PATCH 1/6] fix crash in serveAllFonts variable file does not exist. Backtrace ReferenceError: file is not defined at serve_style.add (/usr/src/app/src/server.js:139:44) at Proxy.add (/usr/src/app/src/serve_style.js:115:28) at addStyle (/usr/src/app/src/server.js:121:31) at fs.readdir (/usr/src/app/src/server.js:215:11) at args (fs.js:140:20) at internal/util.js:370:14 at getDirents (internal/fs/utils.js:149:7) at FSReqWrap.req.oncomplete (fs.js:775:7) --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index 59de3cd..9fedc02 100644 --- a/src/server.js +++ b/src/server.js @@ -136,7 +136,7 @@ function start(opts) { return dataItemId; } else { if (fromData || !allowMoreData) { - console.log(`ERROR: style "${file.name}" using unknown mbtiles "${mbtiles}"! Skipping...`); + console.log(`ERROR: style "${item.style}" using unknown mbtiles "${mbtiles}"! Skipping...`); return undefined; } else { let id = mbtiles.substr(0, mbtiles.lastIndexOf('.')) || mbtiles; From e249a3f67d21b7b0b1d62f0386a6de25e1010491 Mon Sep 17 00:00:00 2001 From: David Weber | geOps Date: Thu, 22 Oct 2020 19:09:42 +0200 Subject: [PATCH 2/6] add api key to sprite ressources in style json this make some setups easier becouse sprites can be handeld like any other ressources --- src/serve_style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serve_style.js b/src/serve_style.js index fb75ad8..050e9d1 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -43,7 +43,7 @@ module.exports = { } // mapbox-gl-js viewer cannot handle sprite urls with query if (styleJSON_.sprite) { - styleJSON_.sprite = fixUrl(req, styleJSON_.sprite, item.publicUrl, true); + styleJSON_.sprite = fixUrl(req, styleJSON_.sprite, item.publicUrl, false); } if (styleJSON_.glyphs) { styleJSON_.glyphs = fixUrl(req, styleJSON_.glyphs, item.publicUrl, false); From 39bb7ffbf11b25358630193310956a78b6f02ba7 Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Fri, 23 Oct 2020 15:04:51 +0200 Subject: [PATCH 3/6] enabled syntax highlighting --- docs/config.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/config.rst b/docs/config.rst index 3bc1a5a..45a8899 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -4,7 +4,9 @@ Configuration file The configuration file defines the behavior of the application. It's a regular JSON file. -Example:: +Example: + +.. code-block:: json { "options": { From 6ae4116ccbcf4a5d2ae6d20aad860f712b631f47 Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Fri, 23 Oct 2020 15:05:36 +0200 Subject: [PATCH 4/6] fixed small errors --- docs/config.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 45a8899..397725a 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -103,7 +103,7 @@ Default is ``2048``. -------------- Additional image side length added during tile rendering that is cropped from the delivered tile. This is useful for resolving the issue with cropped labels, -but it does come with a performance degradation, because additional, adjacent vector tiles need to be loaded to genenrate a single tile. +but it does come with a performance degradation, because additional, adjacent vector tiles need to be loaded to generate a single tile. Default is ``0`` to disable this processing. ``minRendererPoolSizes`` @@ -148,7 +148,7 @@ Each item in this object defines one style (map). It can have the following opti * ``style`` -- name of the style json file [required] * ``serve_rendered`` -- whether to render the raster tiles for this style or not -* ``serve_data`` -- whether to allow acces to the original tiles, sprites and required glyphs +* ``serve_data`` -- whether to allow access to the original tiles, sprites and required glyphs * ``tilejson`` -- properties to add to the TileJSON created for the raster data * ``format`` and ``bounds`` can be especially useful From 4036d528ec9e5dfb0c97d433c12d81f093c5b747 Mon Sep 17 00:00:00 2001 From: bheupers Date: Wed, 4 Nov 2020 14:42:46 +0100 Subject: [PATCH 5/6] Render up to scale level 22 For detailed city rendering we need to render rasterfiles up to and including level 21. Therefore I propose to change the maximum raster level to 22 --- src/serve_rendered.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serve_rendered.js b/src/serve_rendered.js index 418104a..11b6bfb 100644 --- a/src/serve_rendered.js +++ b/src/serve_rendered.js @@ -375,7 +375,7 @@ module.exports = { scale = getScale(req.params.scale), format = req.params.format; if (z < 0 || x < 0 || y < 0 || - z > 20 || x >= Math.pow(2, z) || y >= Math.pow(2, z)) { + z > 22 || x >= Math.pow(2, z) || y >= Math.pow(2, z)) { return res.status(404).send('Out of bounds'); } const tileSize = 256; From 559c3a913e385b79d7a5ab3046f5d20928c67663 Mon Sep 17 00:00:00 2001 From: Kale Blankenship Date: Wed, 4 Nov 2020 09:36:10 -0800 Subject: [PATCH 6/6] update sharp to avoid segfault Before https://github.com/lovell/sharp/commit/e82a585cec48fa7a16e4edcccb1ef9021e27d2ca the server may crash with a segfault when under high load. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7dab91c..5c27890 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "pbf": "3.2.1", "proj4": "2.6.0", "request": "2.88.2", - "sharp": "0.25.1", + "sharp": "0.26.2", "tileserver-gl-styles": "2.0.0" }, "devDependencies": {