mapfish.Strategy.ProtocolListener

A strategy that listens to “crudfinished” and “clear” events triggered by a mapfish.Protocol.TriggerEventDecorator protocol, upon receiving a “crudfinished” event and if the request is of type “read”, the strategy adds the received features to the layer, upon receiving a “clear” event, the strategy destroys the features in the layer.  A mapfish.Protocol.TriggerEventDecorator protocol must be configured in the layer for this strategy to work as expected.

Example usage

var layer = new OpenLayers.Layer.Vector(
    "some layer name", {
        protocol: new mapfish.Protocol.TriggerEventDecorator(someProtocol),
        strategies: [new mapfish.Strategy.ProtocolListener({append: true})]
    }
);

Inherits from

Summary
mapfish.Strategy.ProtocolListenerA strategy that listens to “crudfinished” and “clear” events triggered by a mapfish.Protocol.TriggerEventDecorator protocol, upon receiving a “crudfinished” event and if the request is of type “read”, the strategy adds the received features to the layer, upon receiving a “clear” event, the strategy destroys the features in the layer.
Properties
append{Boolean} If false, existing layer features are destroyed before adding newly read features.
recenter{Boolean} If true, map is recentered to features extent.
Constructor
mapfish.Strategy.ProtocolListenerCreate a new ProtocolListener strategy.

Properties

append

{Boolean} If false, existing layer features are destroyed before adding newly read features.  Defaults to false.

recenter

{Boolean} If true, map is recentered to features extent.  Defaults to false.

Constructor

mapfish.Strategy.ProtocolListener

Create a new ProtocolListener strategy.

Parameters

options{Object} Optional object whose properties will be set on the instance.
Decorator class responsible to trigger events when requests are sent and received.
Abstract vector layer strategy class.
Close