diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index 5744633a..92ba4ea6 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -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,