Add PLACEMENT default getter

This commit is contained in:
Daniel García Aubert
2017-12-18 18:24:09 +01:00
parent 878f3bd627
commit 2068861988
@@ -2,10 +2,6 @@ const MapConfig = require('windshaft').model.MapConfig;
const aggregationQuery = require('./aggregation-query');
module.exports = class AggregationMapConfig extends MapConfig {
static get THRESHOLD () {
return 1e5; // 100K
}
static get PLACEMENTS () {
return [
'centroid',
@@ -14,6 +10,14 @@ module.exports = class AggregationMapConfig extends MapConfig {
];
}
static get PLACEMENT () {
return AggregationMapConfig.PLACEMENTS[0];
}
static get THRESHOLD () {
return 1e5; // 100K
}
constructor (config, datasource) {
super(config, datasource);
@@ -25,7 +29,7 @@ module.exports = class AggregationMapConfig extends MapConfig {
const {
resolution = 1,
threshold = AggregationMapConfig.THRESHOLD,
placement = 'centroid',
placement = AggregationMapConfig.PLACEMENT,
columns = {},
dimmensions = {}
} = this.getAggregation(index);