mapfish.widgets.data.FeatureStoreMediator

This class is to be used when one wants to insert features in a store.

Usage example

var store = new Ext.data.Store({
    reader: new mapfish.widgets.data.FeatureReader(
        {}, [{name: "name", type: "string"}]
    )
});
var mediator = new mapfish.widgets.data.FeatureStoreMediator({
    store: store,
    append: false,
    filter: function(feature) {
        return feature.state != OpenLayers.State.UNKNOWN;
    }
});
Summary
mapfish.widgets.data.FeatureStoreMediatorThis class is to be used when one wants to insert features in a store.
Constructor
mapfish.widgets.data.FeatureStoreMediatorCreate an instance of mapfish.widgets.data.FeatureStoreMediator
Properties
store{Ext.data.Store} An Ext data store
append{Boolean} False if the store must be cleared before adding new features into it, false otherwise; defaults to true.
filter{Function} a filter function called for each feature to be inserted, the feature is passed as an argument to the function, if it returns true the feature is inserted into the store, otherwise the feature is not inserted.
Functions
addFeaturesAdd features to the store.
removeFeaturesRemove features from the store.

Constructor

mapfish.widgets.data.FeatureStoreMediator

Create an instance of mapfish.widgets.data.FeatureStoreMediator

Parameters

config{Object} A config object used to set the feature store mediator’s properties, see below for the list of supported properties.

Returns

{mapfish.widgets.data.FeatureStoreMediator}

Properties

store

{Ext.data.Store} An Ext data store

append

{Boolean} False if the store must be cleared before adding new features into it, false otherwise; defaults to true.

filter

{Function} a filter function called for each feature to be inserted, the feature is passed as an argument to the function, if it returns true the feature is inserted into the store, otherwise the feature is not inserted.

Functions

addFeatures

addFeatures: function(features,
config)

Add features to the store.

Parameters

features{OpenLayers.Feature.Vector} or {Array{OpenLayers.Feature.Vector}} A feature or an array of features to add to the store.
configa config object which can include the properties “append” and “filter”, if set these properties will override that set in the object.

removeFeatures

removeFeatures: function(features)

Remove features from the store.

Parameters

features{OpenLayers.Feature.Vector} or {Array{OpenLayers.Feature.Vector}} A feature or an array of features to remove from the store.  If null all the features in the store are removed.
addFeatures: function(features,
config)
Add features to the store.
removeFeatures: function(features)
Remove features from the store.
Create an instance of mapfish.widgets.data.FeatureStoreMediator
Vector features use the OpenLayers.Geometry classes as geometry description.
Close