Constructor
new VectorFilter()
- Since:
- Source:
Extends
Members
defaults :Object
Default attributes for VectorFilter models
Type:
Properties:
Name |
Type |
Attributes |
Default |
Description |
filterType |
'categorical'
|
'numeric'
|
<optional>
|
'categorical'
|
If
categorical, then a feature will be visible when its property value exactly
matches one of those listed in the values attribute. If numerical, then a
feature will be visible when its property value is between the min and max. |
property |
string
|
|
|
The property (attribute) of the feature to filter
on. |
values |
Array.<string>
|
Array.<number>
|
|
|
Only used for categorical filters. If
the property matches one of the values listed, the feature will be displayed.
If the filter type is categorical and no values are set, then features will not
be filtered on this property. |
max |
number
|
|
|
Only used for numeric filters. The property's value must
be less than the value set here for the feature to be visible. If the filter
type is numeric, and max is set, then the max is infinite. |
min |
number
|
|
|
Only used for numeric filters. The property's value must
be greater than the value set here for the feature to be visible. If the filter
type is numeric, and min is set, then the min is minus infinity. |
- Source:
type :string
The name of this type of model
Type:
- Source:
Methods
featureIsVisible(properties) → {boolean}
This function checks if a feature is visible based on the filter's rules.
Parameters:
Name |
Type |
Description |
properties |
Object
|
The properties of the feature to be filtered. (See
the 'properties' attribute of Feature#defaults.) |
- Source:
Returns:
Returns true if the feature properties pass this filter
-
Type
-
boolean
initialize()
- Source:
isActive() → {boolean}
This function checks if the filter is active based on its configuration.
A filter is considered active if it has values set (for categorical filters)
or if it has a min or max set (for numeric filters).
- Since:
- Source:
Returns:
Returns true if the filter is active, false otherwise.
-
Type
-
boolean
setActiveState()
Sets the active state of the filter based values (for categorical
filters) or min/max (for numeric filters).
- Since:
- Source: