GeoExt

Table Of Contents

Previous topic

Widgets

Next topic

GeoExt.FeatureRenderer

GeoExt.Action

Extends
class GeoExt.Action(config)
Create a GeoExt.Action instance. A GeoExt.Action is created to insert an OpenLayers control in a toolbar as a button or in a menu as a menu item. A GeoExt.Action instance can be used like a regular Ext.Action, look at the Ext.Action API doc for more detail.

Example Use

Sample code to create a toolbar with an OpenLayers control into it.

var action = new GeoExt.Action({
    text: "max extent",
    control: new OpenLayers.Control.ZoomToMaxExtent(),
    map: map
});
var toolbar = new Ext.Toolbar([action]);

Config Options

Configuration properties in addition to those listed for Ext.Action.

activateOnEnable
Boolean Activate the action’s control when the action is enabled. Default is false.
control
OpenLayers.Control The OpenLayers control wrapped in this action.
deactivateOnDisable
Boolean Deactivate the action’s control when the action is disabled. Default is false.
map
OpenLayers.Map The OpenLayers map that the control should be added to. For controls that don’t need to be added to a map or have already been added to one, this config property may be omitted.

Public Properties

Public properties in addition to those listed for Ext.Action.

Action.activateOnEnable
Boolean Activate the action’s control when the action is enabled.
Action.deactivateOnDisable
Boolean Deactivate the action’s control when the action is disabled.