OpenLayers.Strategy.BBOX

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

Inherits from

Summary
OpenLayers.Strategy.BBOXA simple strategy that reads new features when the viewport invalidates some bounds.
Properties
bounds{OpenLayers.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{OpenLayers.Protocol.Response} The protocol response object returned by the layer protocol.
Constructor
OpenLayers.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{OpenLayers.Protocol.Response} The protocol response object returned by the layer protocol.
createFilterReturns {OpenLayers.Filter} The filter object.
mergeGiven a list of features, determine which ones to add to the layer.

Properties

bounds

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

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

Constructor

OpenLayers.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} An object with a property named “force”, this property references a boolean value indicating if new data must be incondtionally read.

getMapBounds

getMapBounds: function()

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

Returns

{OpenLayers.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{OpenLayers.Bounds} the current map extent, will be retrieved from the map object if not provided

Returns

{Boolean}

calculateBounds

calculateBounds: function(mapBounds)

Parameters

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

triggerRead

triggerRead: function()

Returns

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

createFilter

createFilter: function()

Returns {OpenLayers.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{OpenLayers.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()
{OpenLayers.Protocol.Response} The protocol response object returned by the layer protocol.
createFilter: function()
Returns {OpenLayers.Filter} The filter object.
This class represents an OGC 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.
Close