OpenLayers.Control.WMSGetFeatureInfo

The WMSGetFeatureInfo control uses a WMS query to get information about a point on the map.  The information may be in a display-friendly format such as HTML, or a machine-friendly format such as GML, depending on the server’s capabilities and the client’s configuration.  This control handles click or hover events, attempts to parse the results using an OpenLayers.Format, and fires a ‘getfeatureinfo’ event with the click position, the raw body of the response, and an array of features if it successfully read the response.

Inherits from

Summary
OpenLayers.Control.WMSGetFeatureInfoThe WMSGetFeatureInfo control uses a WMS query to get information about a point on the map.
Properties
hover{Boolean} Send GetFeatureInfo requests when mouse stops moving.
drillDown{Boolean} Drill down over all WMS layers in the map.
maxFeatures{Integer} Maximum number of features to return from a WMS query.
clickCallback{String} The click callback to register in the {OpenLayers.Handler.Click} object created when the hover option is set to false.
output{String} Either “features” or “object”.
handlerOptions{Object} Additional options for the handlers used by this control, e.g.
events{OpenLayers.Events} Events instance for listeners and triggering control specific events.
Constructor
<OpenLayers.Control.WMSGetFeatureInfo>

Properties

hover

{Boolean} Send GetFeatureInfo requests when mouse stops moving.  Default is false.

drillDown

{Boolean} Drill down over all WMS layers in the map.  When using drillDown mode, hover is not possible, and an infoFormat that returns parseable features is required.  Default is false.

maxFeatures

{Integer} Maximum number of features to return from a WMS query.  This sets the feature_count parameter on WMS GetFeatureInfo requests.

clickCallback

{String} The click callback to register in the {OpenLayers.Handler.Click} object created when the hover option is set to false.  Default is “click”.

output

{String} Either “features” or “object”.  When triggering a getfeatureinfo request should we pass on an array of features or an object with with a “features” property and other properties (such as the url of the WMS).  Default is “features”.

handlerOptions

{Object} Additional options for the handlers used by this control, e.g.

{
    "click": {delay: 100},
    "hover": {delay: 300}
}

events

{OpenLayers.Events} Events instance for listeners and triggering control specific events.

Register a listener for a particular event with the following syntax

control.events.register(type, obj, listener);

Supported event types (in addition to those from OpenLayers.Control.events)

beforegetfeatureinfoTriggered before the request is sent.  The event object has an xy property with the position of the mouse click or hover event that triggers the request.
nogetfeatureinfono queryable layers were found.
getfeatureinfoTriggered when a GetFeatureInfo response is received.  The event object has a text property with the body of the response (String), a features property with an array of the parsed features, an xy property with the position of the mouse click or hover event that triggered the request, and a request property with the request itself.  If drillDown is set to true and multiple requests were issued to collect feature info from all layers, text and request will only contain the response body and request object of the last request.

Constructor

<OpenLayers.Control.WMSGetFeatureInfo>

Parameters

options{Object}
A handler for mouse clicks.
Controls affect the display or behavior of the map.
{OpenLayers.Events} Events instance for listeners and triggering control specific events.
Close