ALKMaps.Strategy.BBOX

A simple strategy that reads new features when the viewport invalidates some bounds.

Inherits from

Summary
ALKMaps.Strategy.BBOXA simple strategy that reads new features when the viewport invalidates some bounds.
Properties
bounds{ALKMaps.Bounds} The current data bounds (in the same projection as the layer - not always the same projection as the map).
resolution{Float} The current data resolution.
ratio{Float} The ratio of the data bounds to the viewport bounds (in each dimension).
resFactor{Float} Optional factor used to determine when previously requested features are invalid.
response{ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol.
Constructor
ALKMaps.Strategy.BBOXCreate a new BBOX strategy.
Functions
activateSet up strategy with regard to reading new batches of remote data.
deactivateTear down strategy with regard to reading new batches of remote data.
updateCallback function called on “moveend” or “refresh” layer events.
getMapBoundsGet the map bounds expressed in the same projection as this layer.
invalidBoundsDetermine whether the previously requested set of features is invalid.
calculateBounds
triggerRead
createFilterCreates a spatial BBOX filter.
mergeGiven a list of features, determine which ones to add to the layer.

Properties

bounds

{ALKMaps.Bounds} The current data bounds (in the same projection as the layer - not always the same projection as the map).

resolution

{Float} The current data resolution.

ratio

{Float} The ratio of the data bounds to the viewport bounds (in each dimension).  Default is 2.

resFactor

{Float} Optional factor used to determine when previously requested features are invalid.  If set, the resFactor will be compared to the resolution of the previous request to the current map resolution.  If resFactor > (old / new) and 1/resFactor < (old / new).  If you set a resFactor of 1, data will be requested every time the resolution changes.  If you set a resFactor of 3, data will be requested if the old resolution is 3 times the new, or if the new is 3 times the old.  If the old bounds do not contain the new bounds new data will always be requested (with or without considering resFactor).

response

{ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol.

Constructor

ALKMaps.Strategy.BBOX

Create a new BBOX strategy.

Parameters

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

Functions

activate

activate: function()

Set up strategy with regard to reading new batches of remote data.

Returns

{Boolean} The strategy was successfully activated.

deactivate

deactivate: function()

Tear down strategy with regard to reading new batches of remote data.

Returns

{Boolean} The strategy was successfully deactivated.

update

update: function(options)

Callback function called on “moveend” or “refresh” layer events.

Parameters

options{Object} Optional object whose properties will determine the behavior of this Strategy

Valid options include

force{Boolean} if true, new data must be unconditionally read.
noAbort{Boolean} if true, do not abort previous requests.

getMapBounds

getMapBounds: function()

Get the map bounds expressed in the same projection as this layer.

Returns

{ALKMaps.Bounds} Map bounds in the projection of the layer.

invalidBounds

invalidBounds: function(mapBounds)

Determine whether the previously requested set of features is invalid.  This occurs when the new map bounds do not contain the previously requested bounds.  In addition, if resFactor is set, it will be considered.

Parameters

mapBounds{ALKMaps.Bounds} the current map extent, will be retrieved from the map object if not provided

Returns

{Boolean}

calculateBounds

calculateBounds: function(mapBounds)

Parameters

mapBounds{ALKMaps.Bounds} the current map extent, will be retrieved from the map object if not provided

triggerRead

triggerRead: function(options)

Parameters

options{Object} Additional options for the protocol’s read method (optional)

Returns

{ALKMaps.Protocol.Response} The protocol response object returned by the layer protocol.

createFilter

createFilter: function()

Creates a spatial BBOX filter.  If the layer that this strategy belongs to has a filter property, this filter will be combined with the BBOX filter.

Returns {ALKMaps.Filter} The filter object.

merge

merge: function(resp)

Given a list of features, determine which ones to add to the layer.  If the layer projection differs from the map projection, features will be transformed from the layer projection to the map projection.

Parameters

resp{ALKMaps.Protocol.Response} The response object passed by the protocol.
Instances of this class represent bounding boxes.
Protocols return Response objects to their users.
activate: function()
Set up strategy with regard to reading new batches of remote data.
deactivate: function()
Tear down strategy with regard to reading new batches of remote data.
update: function(options)
Callback function called on “moveend” or “refresh” layer events.
getMapBounds: function()
Get the map bounds expressed in the same projection as this layer.
invalidBounds: function(mapBounds)
Determine whether the previously requested set of features is invalid.
calculateBounds: function(mapBounds)
triggerRead: function(options)
createFilter: function()
Creates a spatial BBOX filter.
merge: function(resp)
Given a list of features, determine which ones to add to the layer.
Abstract vector layer strategy class.
{Float} Optional factor used to determine when previously requested features are invalid.
This class represents an OGC Filter.
Close