Move variable declaration close to the place that it's used
This commit is contained in:
parent
b1f788fb57
commit
446449bbde
@ -142,10 +142,6 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
return resolve({ layer, index, adapted: false });
|
||||
}
|
||||
|
||||
const threshold = layer.options.aggregation && layer.options.aggregation.threshold ?
|
||||
layer.options.aggregation.threshold :
|
||||
1e5;
|
||||
|
||||
const aggregationMetadata = queryUtils.getAggregationMetadata({ query: layer.options.sql });
|
||||
|
||||
connection.query(aggregationMetadata, (err, res) => {
|
||||
@ -154,6 +150,11 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
}
|
||||
|
||||
const estimatedFeatureCount = res.rows[0].count;
|
||||
|
||||
const threshold = layer.options.aggregation && layer.options.aggregation.threshold ?
|
||||
layer.options.aggregation.threshold :
|
||||
1e5;
|
||||
|
||||
const geometryType = res.rows[0].type;
|
||||
|
||||
if (estimatedFeatureCount < threshold) {
|
||||
|
Loading…
Reference in New Issue
Block a user