Remove magic number
This commit is contained in:
parent
0b27d174ef
commit
e26cfb2efb
@ -4,7 +4,11 @@ const RASTER_AGGREGATION = 'RasterAggregation';
|
|||||||
const VECTOR_AGGREGATION = 'VectorAggregation';
|
const VECTOR_AGGREGATION = 'VectorAggregation';
|
||||||
|
|
||||||
module.exports = class AggregationProxy {
|
module.exports = class AggregationProxy {
|
||||||
constructor (mapconfig, query, { resolution = 256, threshold = 1e5, placement = 'centroid', columns = {}} = {}) {
|
static get THRESHOLD() {
|
||||||
|
return 1e5; // 100K
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor (mapconfig, query, { resolution = 256, threshold = AggregationProxy.THRESHOLD, placement = 'centroid', columns = {}} = {}) {
|
||||||
this.mapconfig = mapconfig;
|
this.mapconfig = mapconfig;
|
||||||
this.query = query;
|
this.query = query;
|
||||||
this.resolution = resolution;
|
this.resolution = resolution;
|
||||||
|
@ -177,7 +177,7 @@ module.exports = class AggregationMapConfigAdapter {
|
|||||||
|
|
||||||
const threshold = layer.options.aggregation && layer.options.aggregation.threshold ?
|
const threshold = layer.options.aggregation && layer.options.aggregation.threshold ?
|
||||||
layer.options.aggregation.threshold :
|
layer.options.aggregation.threshold :
|
||||||
1e5;
|
AggregationProxy.THRESHOLD;
|
||||||
|
|
||||||
if (estimatedFeatureCount < threshold) {
|
if (estimatedFeatureCount < threshold) {
|
||||||
return callback(null, shouldAdapt);
|
return callback(null, shouldAdapt);
|
||||||
|
Loading…
Reference in New Issue
Block a user