OpenSpace.Protocol.Boundary

A basic HTTP and JSON protocol for vector boundary layers.  Create a new instance with the OpenSpace.Protocol.Boundary constructor.

Inherits from

  • <OpenLayers.Protocol.HTTP>
Summary
OpenSpace.Protocol.BoundaryA basic HTTP and JSON protocol for vector boundary layers.
Constructor
OpenSpace.Protocol.BoundaryA class for getting boundary layers via a HTTP and JSON protocol.
Functions
destroyClean up the protocol.
createCallbackReturns a function that applies the given public method with resp and options arguments.
readConstruct a request for reading new features.
handleReadIndividual callbacks are created for read, create and update, should a subclass need to override each one separately.
handleResponseCalled by CRUD specific handlers.
parseFeaturesRead HTTP response body and return features.
filterFeaturesFor a point in polygon type boundary search, ensure that the point requested is inside the boundary polygon.

Constructor

OpenSpace.Protocol.Boundary

A class for getting boundary layers via a HTTP and JSON protocol.

Parameters

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

Valid options include

url{String}
headers{Object}
params{Object}
format{<OpenLayers.Format>}
callback{Function}
scope{Object}

Functions

destroy

destroy: function()

Clean up the protocol.

createCallback

createCallback: function(method,
response,
options)

Returns a function that applies the given public method with resp and options arguments.

Parameters

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

read: function(options)

Construct a request for reading new features.

Parameters

options{Object} Optional object for configuring the request.  This object is modified and should not be reused.

Valid options

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.

Returns

{<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

handleRead: function(resp,
options)

Individual callbacks are created for read, create and update, should a subclass need to override each one separately.

Parameters

resp{<OpenLayers.Protocol.Response>} The response object to pass to the user callback.
options{Object} The user options passed to the read call.

handleResponse

handleResponse: function(resp,
options)

Called by CRUD specific handlers.

Parameters

resp{<OpenLayers.Protocol.Response>} The response object to pass to any user callback.
options{Object} The user options passed to the create, read, update, or delete call.

parseFeatures

parseFeatures: function(data)

Read HTTP response body and return features.

Parameters

requestThe response JSON data

Returns

{Array({<OpenLayers.Feature.Vector>})} or {<OpenLayers.Feature.Vector>} Array of features or a single feature.

filterFeatures

filterFeatures: function(features)

For a point in polygon type boundary search, ensure that the point requested is inside the boundary polygon.

Parameters

featuresThe features to filter

Returns

{Array({<OpenLayers.Feature.Vector>})} Array of features that contain the given point.

destroy: function()
Clean up the protocol.
createCallback: function(method,
response,
options)
Returns a function that applies the given public method with resp and options arguments.
read: function(options)
Construct a request for reading new features.
handleRead: function(resp,
options)
Individual callbacks are created for read, create and update, should a subclass need to override each one separately.
handleResponse: function(resp,
options)
Called by CRUD specific handlers.
parseFeatures: function(data)
Read HTTP response body and return features.
filterFeatures: function(features)
For a point in polygon type boundary search, ensure that the point requested is inside the boundary polygon.
A class for getting boundary layers via a HTTP and JSON protocol.
Close