OpenGeo Suite Library

gxp.plugins.WMSGetFeatureInfo

Extends
ptype
gxp_wmsgetfeatureinfo
class gxp.plugins.WMSGetFeatureInfo(config)

This plugins provides an action which, when active, will issue a GetFeatureInfo request to the WMS of all layers on the map. The output will be displayed in a popup.

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 or strings referencing a valid Ext component. Actions provided here may have additional menuText and buttonText properties. The former will be used as text when the action is used in a menu. The latter will be conditionally used on buttons, only if showButtonText is set to true. The native text property will unconditionally be used for 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)?

In case of a string, this can be any string that references an Ext.Container property on the portal, or a unique id configured on a component.

In case of an object, the object has a “target” and an “index” property, so that the tool can be inserted at a specified index in the target.

actionTarget can also be an array of strings or objects, if the action is to be put in more than one place (e.g. a button and a context menu item).

To reference one of the toolbars of an Ext.Panel, ”.tbar”, ”.bbar” or ”.fbar” has to be appended. The default is “map.tbar”. The viewer’s main MapPanel can always be accessed with “map” as actionTarget. Set to null if no actions should be created.

Some tools provide a context menu. To reference this context menu as actionTarget for other tools, configure an id in the tool’s outputConfig, and use the id with ”.contextMenu” appended. In the snippet below, a layer tree is created, with a “Remove layer” action as button on the tree’s top toolbar, and as menu item in its context menu:

{
    xtype: "gxp_layertree",
    outputConfig: {
        id: "tree",
        tbar: []
    }
}, {
    xtype: "gxp_removelayer",
    actionTarget: ["tree.tbar", "tree.contextMenu"]
}

If a tool has both actions and output, and you want to force it to immediately output to a container, set actionTarget to null. If you want to hide the actions, set actionTarget to false. In this case, you should configure a defaultAction to make sure that an action is active.

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.

format

String Either “html” or “grid”. If set to “grid”, GML will be requested from the server and displayed in an Ext.PropertyGrid. Otherwise, the html output from the server will be displayed as-is. Default is “html”.

infoActionTip

String Text for feature info action tooltip (i18n).

itemConfig

Object A configuration object overriding options for the items that get added to the popup for each server response or feature. By default, each item will be configured with the following options:

xtype: "propertygrid", // only for "grid" format
title: feature.fid ? feature.fid : title, // just title for "html" format
source: feature.attributes, // only for "grid" format
html: text, // responseText from server - only for "html" format
layerParams

Array List of param names that should be taken from the layer and added to the GetFeatureInfo request (e.g. [“CQL_FILTER”]).

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 Popups created by this tool are added to the map by default.

popupTitle

String Title for info popup (i18n).

showButtonText

Show the buttonText an action is configured with, if used as a button. Default is false.

text

String Text for the GetFeatureInfo button (i18n).

toggleGroup

String If this tool should be radio-button style toggled with other tools, this string is to identify the toggle group.

vendorParams

Object Optional object with properties to be serialized as vendor specific parameters in the requests (e.g. {buffer: 10}).

Public Properties

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

WMSGetFeatureInfo.active

Boolean Is the tool currently active?

Public Methods

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

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

Activates this tool.

WMSGetFeatureInfo.addActions()
WMSGetFeatureInfo.addOutput()
Parameters: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.

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

Deactivates this tool.

WMSGetFeatureInfo.getState()

:return {Object} Gets the configured tool state. Overwrite in subclasses to return anything other than a copy of the initialConfig property.

WMSGetFeatureInfo.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