A basic HTTP protocol for vector layers. Create a new instance with the OpenLayers.Protocol.HTTP constructor.
OpenLayers. Protocol.HTTP | A basic HTTP protocol for vector layers. |
Constructor | |
OpenLayers. Protocol.HTTP | A class for giving layers generic HTTP protocol. |
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 feature. |
delete | Construct a request deleting a removed feature. |
commit | Iterate over each feature and take action based on the feature state. |
abort | Abort an ongoing request, the response object passed to this method must come from this HTTP protocol (as a result of a create, read, update, delete or commit operation). |
A class for giving layers generic HTTP protocol.
options | {Object} Optional object whose properties will be set on the instance. |
url | {String} |
headers | {Object} |
params | {Object} |
format | {OpenLayers.Format} |
callback | {Function} |
scope | {Object} |
read: function( options )
Construct a request for reading new features.
options | {Object} Optional object for configuring the request. This object is modified and should not be reused. |
url | {String} Url for the request. |
params | {Object} Parameters to get serialized as a query string. |
headers | {Object} Headers to be set on the request. |
filter | {<OpenLayers.Filter.BBOX>} If a bbox filter is sent, it will be serialized according to the OpenSearch Geo extension (bbox=minx,miny,maxx,maxy). Note that a BBOX filter as the child of a logical filter will not be serialized. |
readWithPOST | {Boolean} If the request should be done with POST. |
{OpenLayers.Protocol.Response} A response object, whose “priv” property references the HTTP request, this object is also passed to the callback function when the request completes, its “features” property is then populated with the the features received from the server.
create: function( features, options )
Construct a request for writing newly created features.
features | {Array({OpenLayers.Feature.Vector})} or {OpenLayers.Feature.Vector} |
options | {Object} Optional object for configuring the request. This object is modified and should not be reused. |
{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, whose “priv” property references the HTTP request, this object is also passed to the callback function when the request completes, its “features” property is then populated with the the features received from the server.
update: function( feature, options )
Construct a request updating modified feature.
feature | {OpenLayers.Feature.Vector} |
options | {Object} Optional object for configuring the request. This object is modified and should not be reused. |
{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, whose “priv” property references the HTTP request, this object is also passed to the callback function when the request completes, its “features” property is then populated with the the feature received from the server.
"delete": function( feature, options )
Construct a request deleting a removed feature.
feature | {OpenLayers.Feature.Vector} |
options | {Object} Optional object for configuring the request. This object is modified and should not be reused. |
{OpenLayers.Protocol.Response} An OpenLayers.Protocol.Response object, whose “priv” property references the HTTP request, this object is also passed to the callback function when the request completes.
commit: function( features, options )
Iterate over each feature and take action based on the feature state. Possible actions are create, update and delete.
features | {Array({OpenLayers.Feature.Vector})} |
options | {Object} Optional object for setting up intermediate commit callbacks. |
create | {Object} Optional object to be passed to the create method. |
update | {Object} Optional object to be passed to the update method. |
delete | {Object} Optional object to be passed to the delete method. |
callback | {Function} Optional function to be called when the commit is complete. |
scope | {Object} Optional object to be set as the scope of the callback. |
{Array(OpenLayers.Protocol.Response)} An array of response objects, one per request made to the server, each object’s “priv” property references the corresponding HTTP request.
abort: function( response )
Abort an ongoing request, the response object passed to this method must come from this HTTP protocol (as a result of a create, read, update, delete or commit operation).
response | {OpenLayers.Protocol.Response} |
Clean up the protocol.
destroy: function()
Construct a request for reading new features.
read: function( options )
Construct a request for writing newly created features.
create: function( features, options )
Construct a request updating modified feature.
update: function( feature, options )
Construct a request deleting a removed feature.
"delete": function( feature, options )
Iterate over each feature and take action based on the feature state.
commit: function( features, options )
Abort an ongoing request, the response object passed to this method must come from this HTTP protocol (as a result of a create, read, update, delete or commit operation).
abort: function( response )