OpenLayers. Control. SelectFeature

Selects vector features from a given layer on click or hover.

Inherits from

Summary
Selects vector features from a given layer on click or hover.
{Boolean} Allow selection of multiple geometries
{Boolean} Select on mouse over and deselect on mouse out.
{Function} Optional function to be called when a feature is selected.
{Function} Optional function to be called when a feature is unselected.
{Array(String)} To restrict selecting to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
{Object} The functions that are sent to the handler for callback
{Object} Hash of styles
Called when the feature handler detects a click on a feature
Called when the feature handler detects a mouse-over on a feature.
Called when the feature handler detects a mouse-out on a feature.
Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.
Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.
Set the map property for the control.

Properties

multiple

{Boolean} Allow selection of multiple geometries

hover

{Boolean} Select on mouse over and deselect on mouse out.  If true, this ignores clicks and only listens to mouse moves.

onSelect

{Function} Optional function to be called when a feature is selected.  The function should expect to be called with a feature.

onUnselect

{Function} Optional function to be called when a feature is unselected.  The function should expect to be called with a feature.

geometryTypes

{Array(String)} To restrict selecting to a limited set of geometry types, send a list of strings corresponding to the geometry class names.

callbacks

{Object} The functions that are sent to the handler for callback

selectStyle

{Object} Hash of styles

Constructor

<OpenLayers. Control. SelectFeature>

Parameters

layer{OpenLayers.Layer.Vector}
options{Object}

Functions

clickFeature

clickFeature: function(feature)

Called when the feature handler detects a click on a feature

Parameters

feature{<OpenLayers.Vector.Feature>}

overFeature

overFeature: function(feature)

Called when the feature handler detects a mouse-over on a feature.  Only responds if this.hover is true.

Parameters

feature{OpenLayers.Feature.Vector}

outFeature

outFeature: function(feature)

Called when the feature handler detects a mouse-out on a feature.  Only responds if this.hover is true.

Parameters

feature{OpenLayers.Feature.Vector}

select

select: function(feature)

Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.

Parameters

feature{OpenLayers.Feature.Vector}

unselect

unselect: function(feature)

Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.

Parameters

feature{OpenLayers.Feature.Vector}

setMap

setMap: function(map)

Set the map property for the control.

Parameters

map{OpenLayers.Map}
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Handler to respond to mouse events related to a drawn feature.
clickFeature: function(feature)
Called when the feature handler detects a click on a feature
overFeature: function(feature)
Called when the feature handler detects a mouse-over on a feature.
outFeature: function(feature)
Called when the feature handler detects a mouse-out on a feature.
select: function(feature)
Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.
unselect: function(feature)
Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.
setMap: function(map)
Set the map property for the control.
Controls affect the display or behavior of the map.
Vector features use the OpenLayers.Geometry classes as geometry description.
Instances of OpenLayers.Map are interactive maps embedded in a web page.