# OpenLayers.Strategy.BBOX

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

#### Inherits from

- OpenLayers.Strategy

Summary

OpenLayers.Strategy.BBOX | A 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.BBOX | Create a new BBOX strategy.
Functions |
activate | Set up strategy with regard to reading new batches of remote data.
deactivate | Tear down strategy with regard to reading new batches of remote data.
update | Callback function called on “moveend” or “refresh” layer events.
getMapBounds | Get the map bounds expressed in the same projection as this layer.
invalidBounds | Determine whether the previously requested set of features is invalid.
calculateBounds |
triggerRead |
createFilter | Creates a spatial BBOX filter.
merge | Given 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( | options | )

#### Parameters

options | Additional options for the protocol’s read method (optional)

#### Returns

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