OpenLayers.Strategy.Save

A strategy that commits newly created or modified features.  By default the strategy waits for a call to save before persisting changes.  By configuring the strategy with the auto option, changes can be saved automatically.

Inherits from

Summary
OpenLayers.Strategy.SaveA strategy that commits newly created or modified features.
Properties
auto{Boolean | Number} Auto-save.
Constructor
OpenLayers.Strategy.SaveCreate a new Save strategy.
Functions
activateActivate the strategy.
deactivateDeactivate the strategy.
saveTell the layer protocol to commit unsaved features.

Properties

auto

{Boolean | Number} Auto-save.  Default is false.  If true, features will be saved immediately after being added to the layer and with each modification or deletion.  If auto is a number, features will be saved on an interval provided by the value (in seconds).

Constructor

OpenLayers.Strategy.Save

Create a new Save strategy.

Parameters

options{Object} Optional object whose properties will be set on the instance.

Functions

activate

activate: function()

Activate the strategy.  Register any listeners, do appropriate setup.

Returns

{Boolean} The strategy was successfully activated.

deactivate

deactivate: function()

Deactivate the strategy.  Unregister any listeners, do appropriate tear-down.

Returns

{Boolean} The strategy was successfully deactivated.

save

save: function(features)

Tell the layer protocol to commit unsaved features.  If the layer projection differs from the map projection, features will be transformed into the layer projection before being committed.

Parameters

features{Array} Features to be saved.  If null, then default is all features in the layer.  Features are assumed to be in the map projection.
activate: function()
Activate the strategy.
deactivate: function()
Deactivate the strategy.
save: function(features)
Tell the layer protocol to commit unsaved features.
{Boolean | Number} Auto-save.
Abstract vector layer strategy class.
Close