Use aggregation-mapconfig's method to discover columns to be exposed used to aggregate

This commit is contained in:
Daniel García Aubert 2017-12-28 13:12:41 +01:00
parent d42257127b
commit 9a1bc51fdb

View File

@ -101,18 +101,13 @@ module.exports = class AggregationMapConfigAdapter {
aggregationSql = sqlQueryWrap.replace(/<%=\s*sql\s*%>/g, aggregationSql);
}
if (!mapConfig.isDefaultLayerAggregation(index)) {
layer.options.sql = aggregationSql;
return resolve({ layer, index, adapted: shouldAdapt });
}
const skipGeoms = true;
mapConfig.getLayerColumns(index, skipGeoms, (err, columns) => {
mapConfig.getLayerAggregationColumns(index, (err, columns) => {
if (err) {
return reject(err);
}
layer.options.sql = aggregationSql;
layer.options.columns = columns;
return resolve({ layer, index, adapted: shouldAdapt });