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.
var layer = new OpenLayers.Layer.Vector(
"some layer name", {
protocol: new mapfish.Protocol.TriggerEventDecorator(someProtocol),
strategies: [new mapfish.Strategy.ProtocolListener({append: true})]
}
);| 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. |
| 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. ProtocolListener | Create a new ProtocolListener strategy. |