1 /* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
2 * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
3 * full text of the license. */
6 * Class: OpenLayers.Strategy
7 * Abstract vector layer strategy class. Not to be instantiated directly. Use
8 * one of the strategy subclasses instead.
10 OpenLayers.Strategy = OpenLayers.Class({
14 * {<OpenLayers.Layer.Vector>} The layer this strategy belongs to.
20 * {Object} Any options sent to the constructor.
26 * {Boolean} The control is active.
31 * Property: autoActivate
32 * {Boolean} The creator of the strategy can set autoActivate to false
33 * to fully control when the protocol is activated and deactivated.
39 * Property: autoDestroy
40 * {Boolean} The creator of the strategy can set autoDestroy to false
41 * to fully control when the strategy is destroyed. Defaults to
47 * Constructor: OpenLayers.Strategy
48 * Abstract class for vector strategies. Create instances of a subclass.
51 * options - {Object} Optional object whose properties will be set on the
54 initialize: function(options) {
55 OpenLayers.Util.extend(this, options);
56 this.options = options;
57 // set the active property here, so that user cannot override it
63 * Clean up the strategy.
73 * Called to set the <layer> property.
76 * {<OpenLayers.Layer.Vector>}
78 setLayer: function(layer) {
84 * Activate the strategy. Register any listeners, do appropriate setup.
87 * {Boolean} True if the strategy was successfully activated or false if
88 * the strategy was already active.
90 activate: function() {
100 * Deactivate the strategy. Unregister any listeners, do appropriate
104 * {Boolean} True if the strategy was successfully deactivated or false if
105 * the strategy was already inactive.
107 deactivate: function() {
115 CLASS_NAME: "OpenLayers.Strategy"