OpenLayers. Control. SelectFeature
Selects vector features from a given layer on click or hover.
Inherits from
Summary
OpenLayers. Control. SelectFeature | Selects vector features from a given layer on click or hover. |
Properties | |
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. |
clickout | {Boolean} Unselect features when clicking outside any feature. |
toggle | {Boolean} Unselect a selected feature on click. |
hover | {Boolean} Select on mouse over and deselect on mouse out. |
box | {Boolean} Allow feature selection by drawing a box. |
onSelect | {Function} Optional function to be called when a feature is selected. |
onUnselect | {Function} Optional function to be called when a feature is unselected. |
geometryTypes | {Array(String)} To restrict selecting to a limited set of geometry types, send a list of strings corresponding to the geometry class names. |
layer | {OpenLayers.Layer.Vector} |
callbacks | {Object} The functions that are sent to the handlers.feature for callback |
selectStyle | {Object} Hash of styles |
renderIntent | {String} key used to retrieve the select style from the layer’s style map. |
handlers | {Object} Object with references to multiple OpenLayers.Handler instances. |
Constructor | |
<OpenLayers. Control. SelectFeature> | |
Functions | |
activate | Activates the control. |
deactivate | Deactivates the control. |
unselectAll | Unselect all selected features. |
clickFeature | Called on click in a feature Only responds if this.hover is false. |
multipleSelect | Allow for multiple selected features based on multiple property and multipleKey event modifier. |
toggleSelect | Event should toggle the selected state of a feature based on toggle property and toggleKey event modifier. |
clickoutFeature | Called on click outside a previously clicked (selected) feature. |
overFeature | Called on over a feature. |
outFeature | Called on out of a selected feature. |
select | Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function. |
unselect | Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function. |
selectBox | Callback from the handlers.box set up when box selection is true on. |
setMap | Set the map property for the control. |
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.
clickout
{Boolean} Unselect features when clicking outside any feature. Default is true.
toggle
{Boolean} Unselect a selected feature on click. Default is false. Only has meaning if hover is false.
hover
{Boolean} Select on mouse over and deselect on mouse out. If true, this ignores clicks and only listens to mouse moves.
box
{Boolean} Allow feature selection by drawing a box.
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 handlers.feature for callback
renderIntent
{String} key used to retrieve the select style from the layer’s style map.
<OpenLayers. Control. SelectFeature>
activate
Activates the control.
Returns
{Boolean} The control was effectively activated.
deactivate
Deactivates the control.
Returns
{Boolean} The control was effectively deactivated.
unselectAll
unselectAll: function( | options | ) |
|
Unselect all selected features. To unselect all except for a single feature, set the options.except property to the feature.
Parameters
options | {Object} Optional configuration object. |
clickFeature
clickFeature: function( | feature | ) |
|
Called on click in a feature Only responds if this.hover is false.
Parameters
multipleSelect
multipleSelect: function() |
Allow for multiple selected features based on multiple property and multipleKey event modifier.
Returns
{Boolean} Allow for multiple selected features.
toggleSelect
Event should toggle the selected state of a feature based on toggle property and toggleKey event modifier.
Returns
{Boolean} Toggle the selected state of a feature.
clickoutFeature
clickoutFeature: function( | feature | ) |
|
Called on click outside a previously clicked (selected) feature. Only responds if this.hover is false.
Parameters
feature | {<OpenLayers.Vector.Feature>} |
overFeature
overFeature: function( | feature | ) |
|
Called on over a feature. Only responds if this.hover is true.
Parameters
outFeature
outFeature: function( | feature | ) |
|
Called on out of a selected feature. Only responds if this.hover is true.
Parameters
select
select: function( | feature | ) |
|
Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.
Parameters
unselect
unselect: function( | feature | ) |
|
Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.
Parameters
selectBox
selectBox: function( | position | ) |
|
Callback from the handlers.box set up when box selection is true on.
Parameters
setMap
Set the map property for the control.
Parameters