@mapgear/geoapps > LayerItem > GetFeaturesByFilter2
LayerItem.GetFeaturesByFilter2() method
Retrieve the features specified by the filter in the parameter
Signature:GetFeaturesByFilter2(filter: I.Filter): Promise<I.Feature[]>;
Parameters
Parameter | Type | Description |
---|---|---|
filter | I.Filter | Filter object |
Promise<I.Feature[]>
Features within the filter
Example
Retrieving the features by filter. It will search in all the data within the dataset, retrieving all the features that are available and fullfill the filter parameters.
An example to retrieve the data is as follows:
layer.GetFeaturesByFilter2({ operator: "=", attribute: "foo", value: "bar" }).then((features) => {
console.log(features);
});
The example shown above retrieves all the features where the attribute 'foo' equals to 'bar'