Fix layer filter by query params

This commit is contained in:
Daniel García Aubert 2018-03-23 11:57:28 +01:00
parent 97a49fab2f
commit d3c9da6d5f

View File

@ -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) {