This class is to be used when one wants to insert search results (features) in a store; it works by listening to “crudfinished” and “clear” events triggered by a <mapfish.Protocol.TriggerEvent> protocol.
var protocol = new mapfish.Protocol.TriggerEventDecorator({ protocol: new mapfish.Protocol.MapFish({ url: "web_service_url" }) }); var store = new Ext.data.Store({ reader: new mapfish.widgets.data.FeatureReader( {}, [{name: "name", type: "string"}] ) }); var mediator = new mapfish.widgets.data.SearchStoreMediator({ store: store, protocol: protocol, filter: function(feature) { return feature.state != OpenLayers.State.UNKNOWN; }, append: false // store is cleared before new features are added into it });
mapfish. widgets. data. SearchStoreMediator | This class is to be used when one wants to insert search results (features) in a store; it works by listening to “crudfinished” and “clear” events triggered by a <mapfish.Protocol.TriggerEvent> protocol. |
Constructor | |
mapfish. widgets. data. SearchStoreMediator | Create an instance of mapfish.widgets.data.SearchStoreMediator. |
Properties | |
protocol | {mapfish.Protocol.TriggerEventDecorator} The trigger event decorator protocol. |
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. |
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 the mediator. |
deactivate | Deactivate the mediator. |
Create an instance of mapfish.widgets.data.SearchStoreMediator.
config | {Object} A config object used to set the search store mediator’s properties (see below for the list of supported properties), and configure it with the Ext store; see the usage example above. |
{mapfish.Protocol.TriggerEventDecorator} The trigger event decorator protocol.
Activate the mediator.
activate: function()
Deactivate the mediator.
deactivate: function()