diff --git a/lib/cartodb/controllers/named_maps.js b/lib/cartodb/controllers/named_maps.js index a67befea..5383581c 100644 --- a/lib/cartodb/controllers/named_maps.js +++ b/lib/cartodb/controllers/named_maps.js @@ -118,12 +118,13 @@ function getNamedMapProvider ({ namedMapProviderCache, label, forcedFormat = nul return function getNamedMapProviderMiddleware (req, res, next) { const { user, token, cache_buster, api_key } = res.locals; const { dbuser, dbname, dbpassword, dbhost, dbport } = res.locals; - const { template_id, layer, z, x, y, format } = req.params; + const { template_id, layer: layerFromParams, z, x, y, format } = req.params; + const { layer: layerFromQuery } = req.query; const params = { user, token, cache_buster, api_key, dbuser, dbname, dbpassword, dbhost, dbport, - template_id, layer, z, x, y, format + template_id, layer: (layerFromQuery || layerFromParams), z, x, y, format }; if (forcedFormat) {