Table Of Contents

Previous topic

gxp.plugins.LayerTree

Next topic

gxp.plugins.LoadingIndicator

gxp.plugins.Legend

Extends
ptype
gxp_legend
class gxp.plugins.Legend(config)
Provides an action to display a legend in a new window.

Config Options

Configuration properties in addition to those listed for Ext.util.Observable.

actions
Array Custom actions for tools that do not provide their own. Array elements are expected to be valid Ext config objects. Actions provided here may have an additional menuText property, which will be used as text when the action is used in a menu. The text property will only be used in buttons. Optional, only needed to create custom actions.
actionTarget
Object or String or Array Where to place the tool’s actions (e.g. buttons or menus)? Use null as the default since our tool has both output and action(s).
autoActivate
Boolean Set to false if the tool should be initialized without activating it. Default is true.
controlOptions
Object If this tool is associated with an OpenLayers.Control then this is an optional object to pass to the constructor of the associated OpenLayers.Control.
defaultAction
Number Optional index of an action that should be active by default. Only works for actions that are a GeoExt.Action instance.
menuText
String Text for legend menu item (i18n).
outputAction
Number The actions array index of the action that should trigger this tool’s output. Only valid if actions is configured. Leave this unconfigured if none of the actions should trigger this tool’s output.
outputConfig
Object Optional configuration for the output container. This may be useful to override the xtype (e.g. “window” instead of “gx_popup”), or to provide layout configurations when rendering to an outputTarget.
outputTarget
String Where to add the tool’s output container? This can be any string that references an Ext.Container property on the portal, or “map” to access the viewer’s main map. If not provided, a window will be created.
toggleGroup
String If this tool should be radio-button style toggled with other tools, this string is to identify the toggle group.
tooltip
String Text for legend action tooltip (i18n).

Public Properties

Public properties in addition to those listed for Ext.util.Observable.

Legend.active
Boolean Is the tool currently active?

Public Methods

Public methods in addition to those listed for Ext.util.Observable.

Legend.activate()
Returns:Boolean true when this tool was activated

Activates this tool.

Legend.addActions()
Legend.addOutput()
Parameter:configObject configuration for the Ext.Component to be added to the outputTarget. Properties of this configuration will be overridden by the applications outputConfig for the tool instance. Tool plugins that want to reuse their output (after being closed by a window or crumb panel) can also provide an Ext.Component instance here, if it was previously created with addOutput.
Returns:Ext.Component The component added to the outputTarget.

Adds output to the tool’s outputTarget. This method is meant to be called and/or overridden by subclasses.

Legend.deactivate()
Returns:Boolean true when this tool was deactivated

Deactivates this tool.

Legend.getLegendPanel()
Returns:GeoExt.LegendPanel

Get the legend panel associated with this legend plugin.

Legend.getState()
:return {Object} Gets the configured tool state. Overwrite in subclasses to return anything other than a copy of the initialConfig property.
Legend.removeOutput()
Removes all output created by this tool

Events

Events in addition to those listed for Ext.util.Observable.

activate

Fired when the tool is activated.

Listener arguments: * tool - gxp.plugins.Tool the activated tool

deactivate

Fired when the tool is deactivated.

Listener arguments: * tool - gxp.plugins.Tool the deactivated tool