From 79bd70942b35f548eac44709915857602353e691 Mon Sep 17 00:00:00 2001 From: Hermann Schwarting Date: Wed, 22 Apr 2020 21:02:34 +0200 Subject: [PATCH] Fix preview thumbnail for raster data sources The data sources structure was changed in the 'dynamic_styles' branch introducing a tileJSON object. Adapt the code filling the preview template to the change to get the correct file format instead of "undefined". See also f2dc13e. Fix #440 Preview thumbnail missing for raster data source -- file suffix "undefined" --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index cf15fed..6b258e0 100644 --- a/src/server.js +++ b/src/server.js @@ -362,7 +362,7 @@ function start(opts) { if (!data_.is_vector) { if (center) { const centerPx = mercator.px([center[0], center[1]], center[2]); - data_.thumbnail = `${center[2]}/${Math.floor(centerPx[0] / 256)}/${Math.floor(centerPx[1] / 256)}.${data_.format}`; + data_.thumbnail = `${center[2]}/${Math.floor(centerPx[0] / 256)}/${Math.floor(centerPx[1] / 256)}.${data_.tileJSON.format}`; } data_.xyz_link = utils.getTileUrls(