Remove local variable
This commit is contained in:
parent
6638ba91c3
commit
800870e783
@ -101,10 +101,8 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
}
|
||||
|
||||
_shouldAdaptLayer (connection, mapConfig, layer, index, callback) {
|
||||
let shouldAdapt = false;
|
||||
|
||||
if (!mapConfig.isAggregationLayer(index)) {
|
||||
return callback(null, shouldAdapt);
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
const aggregationMetadata = queryUtils.getAggregationMetadata({
|
||||
@ -113,22 +111,22 @@ module.exports = class AggregationMapConfigAdapter {
|
||||
|
||||
connection.query(aggregationMetadata, (err, res) => {
|
||||
if (err) {
|
||||
return callback(null, shouldAdapt);
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
const result = res.rows[0] || {};
|
||||
|
||||
if (!mapConfig.doesLayerReachThreshold(index, result.count)) {
|
||||
return callback(null, shouldAdapt);
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
if (!AggregationMapConfig.supportsGeometryType(result.type)) {
|
||||
return callback(new Error(unsupportedGeometryTypeErrorMessage({ geometryType: result.type })));
|
||||
return callback(new Error(unsupportedGeometryTypeErrorMessage({
|
||||
geometryType: result.type
|
||||
})));
|
||||
}
|
||||
|
||||
shouldAdapt = true;
|
||||
|
||||
callback(null, shouldAdapt);
|
||||
callback(null, true);
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user