# OpenLayers.Strategy

Abstract vector layer strategy class. Not to be instantiated directly. Use one of the strategy subclasses instead.

Summary

OpenLayers.Strategy | Abstract vector layer strategy class.
Properties |
layer | {OpenLayers.Layer.Vector} The layer this strategy belongs to.
options | {Object} Any options sent to the constructor.
active | {Boolean} The control is active.
autoActivate | {Boolean} The creator of the strategy can set autoActivate to false to fully control when the protocol is activated and deactivated.
autoDestroy | {Boolean} The creator of the strategy can set autoDestroy to false to fully control when the strategy is destroyed.
Constructor |
OpenLayers.Strategy | Abstract class for vector strategies.
Functions |
destroy | Clean up the strategy.
setLayer | Called to set the layer property.
activate | Activate the strategy.
deactivate | Deactivate the strategy.

### Properties

### layer

{OpenLayers.Layer.Vector} The layer this strategy belongs to.

### options

{Object} Any options sent to the constructor.

### active

{Boolean} The control is active.

### autoActivate

{Boolean} The creator of the strategy can set autoActivate to false to fully control when the protocol is activated and deactivated. Defaults to true.

### autoDestroy

{Boolean} The creator of the strategy can set autoDestroy to false to fully control when the strategy is destroyed. Defaults to true.

### Constructor

### OpenLayers.Strategy

Abstract class for vector strategies. Create instances of a subclass.

#### Parameters

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

### Functions

### destroy

> destroy: function()

Clean up the strategy.

### setLayer

> setLayer: function( | layer | )

Called to set the layer property.

#### Parameters

{OpenLayers.Layer.Vector}

### activate

> activate: function()

Activate the strategy. Register any listeners, do appropriate setup.

#### Returns

{Boolean} True if the strategy was successfully activated or false if the strategy was already active.

### deactivate

> deactivate: function()

Deactivate the strategy. Unregister any listeners, do appropriate tear-down.

#### Returns

{Boolean} True if the strategy was successfully deactivated or false if the strategy was already inactive.

Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.

> destroy: function()

Clean up the strategy.

> setLayer: function( | layer | )

Called to set the layer property.
{OpenLayers.Layer.Vector} The layer this strategy belongs to.

> activate: function()

Activate the strategy.

> deactivate: function()

Deactivate the strategy.
Close