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 to retrieve features from a server and fires events that notify applications of the selected features.
OpenLayers.
|
Gets 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. |
single | {Boolean} Tells whether select by click should select a single feature. |
clickout | {Boolean} Unselect features when clicking outside any feature. |
toggle | {Boolean} Unselect a selected feature on click. |
clickTolerance | {Integer} Tolerance for the filter 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 in single mode if supported by the protocol. |
handlerOptions | {Object} Additional options for the handlers used by this control. |
events | {OpenLayers.Events} Events instance for listeners and triggering control specific events. |
Constructor | |
OpenLayers.
|
Create a new control for fetching remote features. |
{OpenLayers.Protocol} Required. The protocol used for fetching features.
{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the multiple property to true. Default is null.
{String} An event modifier (‘altKey’ or ‘shiftKey’) that temporarily sets the toggle property to true. Default is null.
{Boolean} Tells whether select by click should select a single feature. If set to false, all matching features are selected. If set to true, only the best matching feature is selected. This option has an effect only of the click option is set to true. Default is true.
{Boolean} Unselect features when clicking outside any feature. Applies only if click is true. Default is true.
{Boolean} Unselect a selected feature on click. Applies only if click is true. Default is false.
{Integer} Maximum number of features to return from a query in single mode if supported by the protocol. This set of features is then used to determine the best match client-side. Default is 10.
{OpenLayers.Events} Events instance for listeners and triggering control specific events.
control.events.register(type, obj, listener);
beforefeatureselected | Triggered when click is true before a feature is selected. The event object has a feature property with the feature about to select |
featureselected | Triggered when click is true and a feature is selected. The event object has a feature property with the selected feature |
beforefeaturesselected | Triggered when click is true before a set of features is selected. The event object is an array of feature properties with the features about to be selected. Return false after receiving this event to discontinue processing of all featureselected events and the featuresselected event. |
featuresselected | Triggered when click is true and a set of features is selected. The event object is an array of feature properties of the selected features |
featureunselected | Triggered when click is true and a feature is unselected. The event object has a feature property with the unselected feature |
clickout | Triggered when when click is true and no feature was selected. |
hoverfeature | Triggered when hover is true and the mouse has stopped over a feature |
outfeature | Triggered when hover is true and the mouse moves moved away from a hover-selected feature |
Create a new control for fetching remote features.
options | {Object} A configuration object which at least has to contain a protocol property (if not, it has to be set before a request is made) |