OpenLayers. Control. GetFeature

Gets vector features for locations underneath the mouse cursor.  Can be configured to act on click, hover or dragged boxes.  Uses an OpenLayers.Protocol that supports spatial filters (BBOX) to retrieve features from a server and fires events that notify applications of the selected features.

Inherits from

Summary
OpenLayers. Control. GetFeatureGets vector features for locations underneath the mouse cursor.
Properties
protocol{OpenLayers.Protocol} Required.
multipleKey{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the multiple property to true.
toggleKey{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the toggle property to true.
multiple{Boolean} Allow selection of multiple geometries.
click{Boolean} Use a click handler for selecting/unselecting features.
clickout{Boolean} Unselect features when clicking outside any feature.
toggle{Boolean} Unselect a selected feature on click.
clickTolerance{Integer} Tolerance for the BBOX query in pixels.
hover{Boolean} Send feature requests on mouse moves.
box{Boolean} Allow feature selection by drawing a box.
maxFeatures{Integer} Maximum number of features to return from a query, if supported by the protocol.
handlerOptions{Object} Additional options for the handlers used by this control.
Constants
EVENT_TYPES
Constructor
OpenLayers. Control. GetFeatureCreate a new control for fetching remote features.

Properties

protocol

{OpenLayers.Protocol} Required.  The protocol used for fetching features.

multipleKey

{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the multiple property to true.  Default is null.

toggleKey

{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the toggle property to true.  Default is null.

multiple

{Boolean} Allow selection of multiple geometries.  Default is false.

click

{Boolean} Use a click handler for selecting/unselecting features.  Default is true.

clickout

{Boolean} Unselect features when clicking outside any feature.  Applies only if click is true.  Default is true.

toggle

{Boolean} Unselect a selected feature on click.  Applies only if click is true.  Default is false.

clickTolerance

{Integer} Tolerance for the BBOX query in pixels.  This has the same effect as the tolerance parameter on WMS GetFeatureInfo requests.  Will be ignored for box selections.  Applies only if click of hover is true.  Default is 5.  Note that this not only affects requests on click, but also on hover.

hover

{Boolean} Send feature requests on mouse moves.  Default is false.

box

{Boolean} Allow feature selection by drawing a box.

maxFeatures

{Integer} Maximum number of features to return from a query, if supported by the protocol.  Default is 10.

handlerOptions

{Object} Additional options for the handlers used by this control.  This is a hash with the keys “click”, “box” and “hover”.

Constants

EVENT_TYPES

Supported event types

beforefeatureselectedTriggered when click is true before a feature is selected.  The event object has a feature property with the feature about to select
featureselectedTriggered when click is true and a feature is selected.  The event object has a feature property with the selected feature
featureunselectedTriggered when click is true and a feature is unselected.  The event object has a feature property with the unselected feature
clickoutTriggered when when click is true and no feature was selected.
hoverfeatureTriggered when hover is true and the mouse has stopped over a feature
outfeatureTriggered when hover is true and the mouse moves moved away from a hover-selected feature

Constructor

OpenLayers. Control. GetFeature

Create a new control for fetching remote features.

Parameters

options{Object} A configuration object which at least has to contain a protocol property
Abstract vector layer protocol class.
{Boolean} Allow selection of multiple geometries.
{Boolean} Unselect a selected feature on click.
{OpenLayers.Protocol} Required.
Controls affect the display or behavior of the map.
{Boolean} Use a click handler for selecting/unselecting features.
{Boolean} Send feature requests on mouse moves.
Close