Fix regression: default to all layers if layer filter is not provided

This commit is contained in:
Daniel García Aubert 2018-01-16 17:57:22 +01:00
parent 76da828168
commit da32d96607

View File

@ -85,6 +85,12 @@ NamedMapsController.prototype.getNamedMapProvider = function (label) {
const { user } = res.locals;
const { config, auth_token } = req.query;
const { template_id } = req.params;
// We force always the tile to be generated using PNG because
// is the only format we support by now
res.locals.format = 'png';
res.locals.layer = res.locals.layer || 'all';
const params = getRequestParams(res.locals);
this.namedMapProviderCache.get(user, template_id, config, auth_token, params, (err, namedMapProvider) => {
@ -311,10 +317,6 @@ NamedMapsController.prototype.getImage = function (label) {
height = +height;
const format = req.params.format === 'jpg' ? 'jpeg' : 'png';
// We force always the tile to be generated using PNG because
// is the only format we support by now
res.locals.format = 'png';
res.locals.layer = res.locals.layer || 'all';
if (zoom !== undefined && center) {
return this.previewBackend.getImage(namedMapProvider, format, width, height, zoom, center,