Get the right columns from aggregation

This commit is contained in:
Daniel García Aubert 2017-12-12 11:57:38 +01:00
parent acd0610517
commit e93fe13b41

View File

@ -44,6 +44,8 @@ module.exports = class AggregationMapConfigAdapter {
const aggregationColumns = this._getAggregationColumns(aggregation);
const layerColumns = mapConfig.getColumnsByLayer(index);
console.log(aggregationColumns, layerColumns);
if (layerColumns.length === 0) {
continue;
}
@ -210,12 +212,11 @@ module.exports = class AggregationMapConfigAdapter {
const hasAggregationColumns = aggregation !== undefined &&
typeof aggregation !== 'boolean' &&
typeof aggregation.columns === 'object';
let aggregationColumns = [];
if (hasAggregationColumns) {
aggregationColumns = Object.keys(aggregation.columns).map(key => {
return aggregation.columns[key].aggregated_column;
});
aggregationColumns = Object.keys(aggregation.columns);
}
return aggregationColumns;