# OpenLayers.Strategy.Filter

Strategy for limiting features that get added to a layer by evaluating a filter. The strategy maintains a cache of all features until removeFeatures is called on the layer.

#### Inherits from

- OpenLayers.Strategy

Summary

OpenLayers.Strategy.Filter | Strategy for limiting features that get added to a layer by evaluating a filter.
Properties |
filter | {OpenLayers.Filter} Filter for limiting features sent to the layer.
Constructor |
OpenLayers.Strategy.Filter | Create a new filter strategy.
Functions |
activate | Activate the strategy.
deactivate | Deactivate the strategy.
setFilter | Update the filter for this strategy.

### Properties

### filter

{OpenLayers.Filter} Filter for limiting features sent to the layer. Use the setFilter method to update this filter after construction.

### Constructor

### OpenLayers.Strategy.Filter

Create a new filter strategy.

#### Parameters

options | {Object} Optional object whose properties will be set on the instance.

### Functions

### activate

> activate: function()

Activate the strategy. Register any listeners, do appropriate setup. By default, this strategy automatically activates itself when a layer is added to a map.

#### Returns

{Boolean} True if the strategy was successfully activated or false if the strategy was already active.

### deactivate

> deactivate: function()

Deactivate the strategy. Clear the feature cache.

#### Returns

{Boolean} True if the strategy was successfully deactivated or false if the strategy was already inactive.

### setFilter

> setFilter: function( | filter | )

Update the filter for this strategy. This will re-evaluate any features on the layer and in the cache. Only features for which filter.evalute(feature) returns true will be added to the layer. Others will be cached by the strategy.

#### Parameters

filter | OpenLayers.Filter A filter for evaluating features.

This class represents an OGC Filter.

> activate: function()

Activate the strategy.

> deactivate: function()

Deactivate the strategy.

> setFilter: function( | filter | )

Update the filter for this strategy.
Abstract vector layer strategy class.
Close