Abstract vector layer protocol class. Not to be instantiated directly. Use one of the protocol subclasses instead.
ALKMaps. | Abstract vector layer protocol class. |
Properties | |
format | {ALKMaps.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. |
defaultFilter | {ALKMaps.Filter} Optional default filter to read requests |
Constructor | |
ALKMaps. | Abstract class for vector protocols. |
Functions | |
mergeWithDefaultFilter | Merge filter passed to the read method with the default one |
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. |
abort | Abort an ongoing request. |
createCallback | Returns a function that applies the given public method with resp and options arguments. |
ALKMaps. | Protocols return Response objects to their users. |
Properties | |
code | |
requestType | {String} The type of request this response corresponds to. |
last | |
features | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server. |
data | {Object} The data returned in the response by the server. |
reqFeatures | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol. |
priv | |
error | {Object} The error object in case a service exception was encountered. |
Constructor | |
ALKMaps. | |
Functions | |
success |
{ALKMaps.Format} The format used by this protocol.
{ALKMaps.Filter} Optional default filter to read requests
mergeWithDefaultFilter: function( filter )
Merge filter passed to the read method with the default one
filter | {ALKMaps.Filter} |
read: function( options )
Construct a request for reading new features.
options | {Object} Optional object for configuring the request. |
{ALKMaps.Protocol.Response} An ALKMaps.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.
create: function()
Construct a request for writing newly created features.
features | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} |
options | {Object} Optional object for configuring the request. |
{ALKMaps.Protocol.Response} An ALKMaps.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.
update: function()
Construct a request updating modified features.
features | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} |
options | {Object} Optional object for configuring the request. |
{ALKMaps.Protocol.Response} An ALKMaps.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.
"delete": function()
Construct a request deleting a removed feature.
feature | {ALKMaps.Feature.Vector} |
options | {Object} Optional object for configuring the request. |
{ALKMaps.Protocol.Response} An ALKMaps.Protocol.Response object, the same object will be passed to the callback function passed if one exists in the options object.
commit: function()
Go over the features and for each take action based on the feature state. Possible actions are create, update and delete.
features | {Array({ALKMaps.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. |
{Array({ALKMaps.Protocol.Response})} An array of ALKMaps.Protocol.Response objects.
createCallback: function( method, response, options )
Returns a function that applies the given public method with resp and options arguments.
method | {Function} The method to be applied by the callback. |
response | {ALKMaps.Protocol.Response} The protocol response object. |
options | {Object} Options sent to the protocol method |
Protocols return Response objects to their users.
Properties | |
code | |
requestType | {String} The type of request this response corresponds to. |
last | |
features | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server. |
data | {Object} The data returned in the response by the server. |
reqFeatures | {Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol. |
priv | |
error | {Object} The error object in case a service exception was encountered. |
Constructor | |
ALKMaps. | |
Functions | |
success |
{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features returned in the response by the server. Depending on the protocol’s read payload, either features or data will be populated.
{Array({ALKMaps.Feature.Vector})} or {ALKMaps.Feature.Vector} The features provided by the user and placed in the request by the protocol.
Merge filter passed to the read method with the default one
mergeWithDefaultFilter: function( filter )
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()
Construct a request updating modified features.
update: function()
Construct a request deleting a removed feature.
"delete": function()
Go over the features and for each take action based on the feature state.
commit: function()
Abort an ongoing request.
abort: function( response )
Returns a function that applies the given public method with resp and options arguments.
createCallback: function( method, response, options )
success: function()