OpenLayers.Protocol - OpenLayers

# OpenLayers. Protocol

Abstract vector layer protocol class. Not to be instantiated directly. Use one of the protocol subclasses instead.

Summary

OpenLayers. Protocol | Abstract vector layer protocol class.
Properties |
format | {OpenLayers.Format} The format used by this protocol.
options | {Object} Any options sent to the constructor.
autoDestroy | {Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed.
Constructor |
OpenLayers. Protocol | Abstract class for vector protocols.
Functions |
destroy | Clean up the protocol.
read | Construct a request for reading new features.
create | Construct a request for writing newly created features.
update | Construct a request updating modified features.
delete | Construct a request deleting a removed feature.
commit | Go over the features and for each take action based on the feature state.
OpenLayers. Protocol. Response | Protocols return Response objects to their users.
Properties |
code |
requestType | {String} The type of request this response corresponds to.
last |
features | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.
reqFeatures | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.
priv |
Constructor |
OpenLayers. Protocol. Response |
Functions |
success |

### Properties

### format

{OpenLayers.Format} The format used by this protocol.

### options

{Object} Any options sent to the constructor.

### autoDestroy

{Boolean} The creator of the protocol can set autoDestroy to false to fully control when the protocol is destroyed. Defaults to true.

### Constructor

### OpenLayers. Protocol

Abstract class for vector protocols. Create instances of a subclass.

#### Parameters

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

### Functions

### destroy

> destroy: function()

Clean up the protocol.

### read

> read: function()

Construct a request for reading new features.

#### Parameters

options | {Object} Optional object for configuring the request.

#### Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

### create

> create: function()

Construct a request for writing newly created features.

#### Parameters

features | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector}
options | {Object} Optional object for configuring the request.

#### Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

### update

> update: function()

Construct a request updating modified features.

#### Parameters

features | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector}
options | {Object} Optional object for configuring the request.

#### Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

### delete

> "delete": function()

Construct a request deleting a removed feature.

#### Parameters

feature | {OpenLayers.Feature.Vector}
options | {Object} Optional object for configuring the request.

#### Returns

{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.

### commit

> commit: function()

Go over the features and for each take action based on the feature state. Possible actions are create, update and delete.

#### Parameters

features | {Array({OpenLayers.Feature.Vector})}
options | {Object} Object whose possible keys are “create”, “update”, “delete”, “callback” and “scope”, the values referenced by the first three are objects as passed to the “create”, “update”, and “delete” methods, the value referenced by the “callback” key is a function which is called when the commit operation is complete using the scope referenced by the “scope” key.

#### Returns

{Array({OpenLayers.Protocol.Response})} An array of OpenLayers.Protocol.Response objects.

## OpenLayers. Protocol. Response

Protocols return Response objects to their users.

Summary

Properties |
code |
requestType | {String} The type of request this response corresponds to.
last |
features | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.
reqFeatures | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.
priv |
Constructor |
OpenLayers. Protocol. Response |
Functions |
success |

### Properties

### code

{Number} | OpenLayers.Protocol.Response.SUCCESS or OpenLayers.Protocol.Response.FAILURE

### requestType

{String} The type of request this response corresponds to. Either “create”, “read”, “update” or “delete”.

### last

{Boolean} | true if this is the last response expected in a commit, false otherwise, defaults to true.

### features

{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features returned in the response by the server.

### reqFeatures

{Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} The features provided by the user and placed in the request by the protocol.

### priv

### Constructor

### OpenLayers. Protocol. Response

#### Parameters

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

### Functions

### success

> success: function()

#### Returns

{Boolean} | true on success, false otherwise

Base class for format reading/writing a variety of formats.

> destroy: function()

Clean up the protocol.

> read: function()

Construct a request for reading new features.

> create: function()

Construct a request for writing newly created features.

> update: function()

Construct a request updating modified features.

> "delete": function()

Construct a request deleting a removed feature.

> commit: function()

Go over the features and for each take action based on the feature state.
Vector features use the OpenLayers.Geometry classes as geometry description.

> success: function()

Protocols return Response objects to their users.
Close