Get templateHash for static tile request and errored named map instantiations

This commit is contained in:
Daniel García Aubert
2020-04-30 13:09:12 +02:00
parent 8d73571f5b
commit a196a26ab4
4 changed files with 32 additions and 12 deletions
+13 -1
View File
@@ -96,7 +96,19 @@ function getCacheBuster ({ res }) {
}
function getTemplateHash ({ res }) {
return res.locals.templateHash;
if (res.locals.templateHash) {
return res.locals.templateHash;
}
if (res.locals.mapConfigProvider && res.locals.mapConfigProvider.getTemplateHash) {
let templateHash;
try {
templateHash = res.locals.mapConfigProvider.getTemplateHash();
} catch (e) {}
return templateHash;
}
}
function getStatTag ({ res }) {