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.
ALKMaps. | A strategy that commits newly created or modified features. |
Properties | |
events | {ALKMaps.Events} An events object that handles all events on the strategy object. |
events | {ALKMaps.Events} Events instance for triggering this protocol events. |
auto | {Boolean | Number} Auto-save. |
timer | {Number} The id of the timer. |
Constructor | |
ALKMaps. | Create a new Save strategy. |
Functions | |
activate | Activate the strategy. |
deactivate | Deactivate the strategy. |
triggerSave | Registered as a listener. |
save | Tell the layer protocol to commit unsaved features. |
onCommit | Called after protocol commit. |
{ALKMaps.Events} An events object that handles all events on the strategy object.
strategy.events.register(type, obj, listener);
start | Triggered before saving |
success | Triggered after a successful transaction |
fail | Triggered after a failed transaction |
{ALKMaps.Events} Events instance for triggering this protocol events.
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.
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. |
onCommit: function( response )
Called after protocol commit.
response | {ALKMaps.Protocol.Response} A response object. |
Activate the strategy.
activate: function()
Deactivate the strategy.
deactivate: function()
Registered as a listener.
triggerSave: function( event )
Tell the layer protocol to commit unsaved features.
save: function( features )
Called after protocol commit.
onCommit: function( response )