Windshaft-cartodb/lib/backends/stats.js
2019-10-21 19:07:24 +02:00

19 lines
506 B
JavaScript

'use strict';
var layerStats = require('./layer-stats/factory');
function StatsBackend () {
}
module.exports = StatsBackend;
StatsBackend.prototype.getStats = function (mapConfig, dbConnection, callback) {
var enabledFeatures = global.environment.enabledFeatures;
var layerStatsEnabled = enabledFeatures ? enabledFeatures.layerStats : false;
if (layerStatsEnabled) {
layerStats().getStats(mapConfig, dbConnection, callback);
} else {
return callback(null, []);
}
};