A basic HTTP and JSON protocol for vector boundary layers. Create a new instance with the OpenSpace.Protocol.Boundary constructor.
| OpenSpace. | A basic HTTP and JSON protocol for vector boundary layers. |
| Constructor | |
| OpenSpace. | A class for getting boundary layers via a HTTP and JSON protocol. |
| Functions | |
| destroy | Clean up the protocol. |
| createCallback | Returns a function that applies the given public method with resp and options arguments. |
| read | Construct a request for reading new features. |
| handleRead | Individual callbacks are created for read, create and update, should a subclass need to override each one separately. |
| handleResponse | Called by CRUD specific handlers. |
| parseFeatures | Read HTTP response body and return features. |
| filterFeatures | For a point in polygon type boundary search, ensure that the point requested is inside the boundary polygon. |
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 | {<OpenLayers.Protocol.Response>} The protocol response object. |
| options | {Object} Options sent to the protocol method (read, create, update, or delete). |
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. |
{<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.
handleRead: function( resp, options )
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
| resp | {<OpenLayers.Protocol.Response>} The response object to pass to the user callback. |
| options | {Object} The user options passed to the read call. |
Clean up the protocol.
destroy: function()
Returns a function that applies the given public method with resp and options arguments.
createCallback: function( method, response, options )
Construct a request for reading new features.
read: function( options )
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
handleRead: function( resp, options )
Called by CRUD specific handlers.
handleResponse: function( resp, options )
Read HTTP response body and return features.
parseFeatures: function( data )
For a point in polygon type boundary search, ensure that the point requested is inside the boundary polygon.
filterFeatures: function( features )