ALKMaps.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

Summary
ALKMaps.Strategy.FilterStrategy for limiting features that get added to a layer by evaluating a filter.
Properties
filter{ALKMaps.Filter} Filter for limiting features sent to the layer.
cache{Array(ALKMaps.Feature.Vector)} List of currently cached features.
caching{Boolean} The filter is currently caching features.
Constructor
ALKMaps.Strategy.FilterCreate a new filter strategy.
Functions
activateActivate the strategy.
deactivateDeactivate the strategy.
handleAdd
handleRemove
setFilterUpdate the filter for this strategy.

Properties

filter

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

cache

{Array(ALKMaps.Feature.Vector)} List of currently cached features.

caching

{Boolean} The filter is currently caching features.

Constructor

ALKMaps.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.

handleAdd

handleAdd: function(event)

handleRemove

handleRemove: function(event)

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{ALKMaps.Filter} A filter for evaluating features.
This class represents an OGC Filter.
Vector features use the ALKMaps.Geometry classes as geometry description.
activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
handleAdd: function(event)
handleRemove: function(event)
setFilter: function(filter)
Update the filter for this strategy.
Abstract vector layer strategy class.
Close