This class is to be used when one wants to insert features in a store.
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; } });
mapfish. | This class is to be used when one wants to insert features in a store. |
Constructor | |
mapfish. | Create 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 | |
addFeatures | Add features to the store. |
removeFeatures | Remove features from the store. |
addFeatures: function( features, config )
Add features to the store.
features | {OpenLayers.Feature.Vector} or {Array{OpenLayers.Feature.Vector}} A feature or an array of features to add to the store. |
config | a config object which can include the properties “append” and “filter”, if set these properties will override that set in the object. |
removeFeatures: function( features )
Remove features from the store.
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. |
Add features to the store.
addFeatures: function( features, config )
Remove features from the store.
removeFeatures: function( features )