Add support for aggregated columns in mvt format
This commit is contained in:
@@ -72,6 +72,18 @@ module.exports = class AggregationMapConfig extends MapConfig {
|
||||
});
|
||||
}
|
||||
|
||||
getAggregatedColumns (index) {
|
||||
const { aggregation } = this.getLayer(index).options;
|
||||
|
||||
if (aggregation === undefined || aggregation.columns === undefined) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return aggregation.columns
|
||||
.map(({ aggregated_column }) => aggregated_column)
|
||||
.filter(aggregated_column => typeof aggregated_column === 'string');
|
||||
}
|
||||
|
||||
isAggregationMapConfig () {
|
||||
return this.isVectorOnlyMapConfig() || this.hasAnyLayerAggregation();
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
}
|
||||
|
||||
layer.options.sql = aggregationSql;
|
||||
|
||||
const aggregatedColumns = mapConfig.getAggregatedColumns(index);
|
||||
|
||||
layer.options.columns = aggregatedColumns;
|
||||
}
|
||||
|
||||
return resolve({ layer, index, adapted: shouldAdapt });
|
||||
|
||||
Reference in New Issue
Block a user