mapfish.widgets.data.LayerStoreMediator

This class is to be used when one wants to insert, remove, and update features in a grid as a result of features being inserted, removed, modified in a vector layer.

Deprecated

This widget is deprecated and will be removed in next mapfish version.  Please use http://geoext.org/lib/GeoExt/data/FeatureReader.html instead.

Usage example

var layer = new OpenLayers.Layer.Vector("vector");
var store = new Ext.data.Store({
    reader: new mapfish.widgets.data.FeatureReader(
        {}, [{name: "name", type: "string"}]
    )
});
var mediator = new mapfish.widgets.data.LayerStoreMediator({
    store: store,
    layer: layer,
    filter: function(feature) {
        return feature.state != OpenLayers.State.UNKNOWN;
    }
});
Summary
mapfish.widgets.data.LayerStoreMediatorThis class is to be used when one wants to insert, remove, and update features in a grid as a result of features being inserted, removed, modified in a vector layer.
Constructor
mapfish.widgets.data.LayerStoreMediatorCreate an instance of mapfish.widgets.data.LayerStoreMediator.
Properties
layer{OpenLayers.Layer.Vector} The vector layer.
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.
autoActivate{Boolean} True if the mediator must be activated as part of its creation, false otherwise; if false then the mediator must be explicitely activate using the activate method; defaults to true.
Functions
activateActivate the mediator.
deactivateDeactivate the mediator.

Constructor

mapfish.widgets.data.LayerStoreMediator

Create an instance of mapfish.widgets.data.LayerStoreMediator.

Parameters

config{Object} A config object used to set the layer store mediator’s properties (see below for the list of supported properties), and configure it with the Ext store; see the usage example above.

Returns

{mapfish.widgets.data.LayerStoreMediator}

Properties

layer

{OpenLayers.Layer.Vector} The vector layer.

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.

autoActivate

{Boolean} True if the mediator must be activated as part of its creation, false otherwise; if false then the mediator must be explicitely activate using the activate method; defaults to true.

Functions

activate

activate: function()

Activate the mediator.

Returns

{Boolean}False if the mediator was already active, true otherwise.

deactivate

deactivate: function()

Deactivate the mediator.

Returns

{Boolean}False if the mediator was already deactive, true otherwise.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
activate: function()
Activate the mediator.
deactivate: function()
Deactivate the mediator.
Create an instance of mapfish.widgets.data.LayerStoreMediator.
Close