fix: store styleFile in serve_rendered

necessary to implement hot mbtiles reloading

Signed-off-by: David Weber | geOps <david.weber@geops.com>
This commit is contained in:
David Weber | geOps 2023-12-31 13:41:57 +01:00
parent ee1372fd55
commit a088080e27

View file

@ -847,6 +847,7 @@ export const serve_rendered = {
renderersStatic: [], renderersStatic: [],
sources: {}, sources: {},
sourceTypes: {}, sourceTypes: {},
styleFile: '',
}; };
let styleJSON; let styleJSON;
@ -1023,6 +1024,7 @@ export const serve_rendered = {
}; };
const styleFile = params.style; const styleFile = params.style;
map.styleFile = styleFile;
const styleJSONPath = path.resolve(options.paths.styles, styleFile); const styleJSONPath = path.resolve(options.paths.styles, styleFile);
try { try {
styleJSON = JSON.parse(fs.readFileSync(styleJSONPath)); styleJSON = JSON.parse(fs.readFileSync(styleJSONPath));