Filters
Using the addFilter(...)
API function user can set and apply filtering on added layers (based on datasets).
addFilter(filter: FilterCreationProps): Filter
type FilterCreationProps = {
id: string;
type: 'range' | 'select' | 'time-range' | 'multi-select' | 'polygon';
sources: {
dataId?: string;
fieldName: string;
};
value: Range | boolean | Range | string[] | Feature;
};
Parameters
Name Description id string
Unique filter id 'type' string
rangedataId string
(Optional)
Dataset id (if omitted, the first dataset which has a field with the name specified infield
will be used)fieldName string
Name of the field to apply the filter to value FilterValueType
Filter value (the type depends on the filter kind, e.g. an array of two numbers for a range filter)