Include the layers metadata into the layergroup object

This commit is contained in:
Mario de Frutos 2017-05-09 11:59:11 +02:00
parent 525c0f2afa
commit 568d6b5458

View File

@ -372,8 +372,8 @@ MapController.prototype.afterLayergroupCreate = function(req, res, mapconfig, la
return next(err);
}
if (layersStats) {
res.metadata = res.metadata || {};
res.metadata.layers = layersStats;
layergroup.metadata = layergroup.metadata || {};
layergroup.metadata.layers = layersStats;
// backwards compatibility for torque
var torqueMetadata = layersStats.reduce(function(acc, layer, layerId) {
@ -383,7 +383,7 @@ MapController.prototype.afterLayergroupCreate = function(req, res, mapconfig, la
return acc;
}, {});
if (Object.keys(torqueMetadata).length) {
res.metadata.torque = torqueMetadata;
layergroup.metadata.torque = torqueMetadata;
}
}