Include feature flag to enable/disable stats
This commit is contained in:
parent
15c68711aa
commit
759d28f12f
@ -7,6 +7,14 @@ function StatsBackend(rendererCache) {
|
||||
module.exports = StatsBackend;
|
||||
|
||||
StatsBackend.prototype.getStats = function(params, dbConnection, mapConfigProvider, callback) {
|
||||
var layerStats = windshaftStats();
|
||||
layerStats.getStats(this.rendererCache, params, dbConnection, mapConfigProvider, callback);
|
||||
var enabledFeatures = global.environment.enabledFeatures;
|
||||
var layerMetadataEnabled = enabledFeatures ? enabledFeatures.layerMetadata : false;
|
||||
var layerStats;
|
||||
if (layerMetadataEnabled) {
|
||||
layerStats = windshaftStats();
|
||||
layerStats.getStats(this.rendererCache, params, dbConnection, mapConfigProvider, callback);
|
||||
} else {
|
||||
layerStats = windshaftStats('torque');
|
||||
layerStats.getStats(this.rendererCache, params, dbConnection, mapConfigProvider, callback);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user