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.
ALKMaps. | Strategy 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. | Create a new filter strategy. |
Functions | |
activate | Activate the strategy. |
deactivate | Deactivate the strategy. |
handleAdd | |
handleRemove | |
setFilter | Update the filter for this strategy. |
{ALKMaps.Filter} Filter for limiting features sent to the layer. Use the setFilter method to update this filter after construction.
{Array(ALKMaps.Feature.Vector)} List of currently cached features.
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.
filter | {ALKMaps.Filter} A filter for evaluating features. |
Activate the strategy.
activate: function()
Deactivate the strategy.
deactivate: function()
handleAdd: function( event )
handleRemove: function( event )
Update the filter for this strategy.
setFilter: function( filter )