Adds support for category filters
This commit is contained in:
@@ -76,6 +76,20 @@ function shouldAdaptLayers(requestMapConfig) {
|
||||
Array.isArray(requestMapConfig.analyses) && requestMapConfig.analyses.length > 0;
|
||||
}
|
||||
|
||||
var DATAVIEW_TYPE_2_FILTER_TYPE = {
|
||||
aggregation: 'category',
|
||||
histogram: 'range'
|
||||
};
|
||||
function getFilter(dataview, params) {
|
||||
var type = dataview.type;
|
||||
|
||||
return {
|
||||
type: DATAVIEW_TYPE_2_FILTER_TYPE[type],
|
||||
column: dataview.options.column,
|
||||
params: params
|
||||
};
|
||||
}
|
||||
|
||||
AnalysisMapConfigAdapter.prototype.getLayers = function(analysisConfiguration, requestMapConfig, filters, callback) {
|
||||
// jshint maxcomplexity:7
|
||||
filters = filters || {};
|
||||
@@ -91,11 +105,7 @@ AnalysisMapConfigAdapter.prototype.getLayers = function(analysisConfiguration, r
|
||||
bySourceId[sourceId] = {};
|
||||
}
|
||||
|
||||
bySourceId[sourceId][dataviewName] = {
|
||||
type: 'range',
|
||||
column: dataview.options.column,
|
||||
params: dataviewsFilters[dataviewName]
|
||||
};
|
||||
bySourceId[sourceId][dataviewName] = getFilter(dataview, dataviewsFilters[dataviewName]);
|
||||
}
|
||||
return bySourceId;
|
||||
}, {});
|
||||
|
||||
Reference in New Issue
Block a user