diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index 5eb89b58..e476daf3 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -341,9 +341,6 @@ function createLayergroup (mapBackend, userLimitsApi, pgConnection, affectedTabl params ); - res.locals.mapConfig = mapConfig; - res.locals.analysesResults = context.analysesResults; - const mapParams = { dbuser, dbname, dbpassword, dbhost, dbport }; mapBackend.createLayergroup(mapConfig, mapParams, mapConfigProvider, (err, layergroup) => { @@ -353,7 +350,9 @@ function createLayergroup (mapBackend, userLimitsApi, pgConnection, affectedTabl } res.body = layergroup; + res.locals.mapConfig = mapConfig; res.locals.mapConfigProvider = mapConfigProvider; + res.locals.analysesResults = context.analysesResults; next(); });