Selects vector features from a given layer on click or hover.
| 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. |
| 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 handler for callback |
| selectStyle | {Object} Hash of styles |
| renderIntent | {String} key used to retrieve the select style from the layer’s style map. |
| handler | {OpenLayers.Handler.Feature} |
| Constructor | |
| <OpenLayers. Control. SelectFeature> | |
| Functions | |
| 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. |
| setMap | Set the map property for the control. |
{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.
| layer | {OpenLayers.Layer.Vector} |
| options | {Object} |
clickFeature: function( feature )
Called on click in a feature Only responds if this.hover is false.
| feature | {OpenLayers.Feature.Vector} |
multipleSelect: function()
Allow for multiple selected features based on multiple property and multipleKey event modifier.
{Boolean} Allow for multiple selected features.
overFeature: function( feature )
Called on over a feature. Only responds if this.hover is true.
| feature | {OpenLayers.Feature.Vector} |
outFeature: function( feature )
Called on out of a selected feature. Only responds if this.hover is true.
| feature | {OpenLayers.Feature.Vector} |
select: function( feature )
Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.
| feature | {OpenLayers.Feature.Vector} |
unselect: function( feature )
Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.
| feature | {OpenLayers.Feature.Vector} |
Unselect all selected features.
unselectAll: function( options )
Called on click in a feature Only responds if this.hover is false.
clickFeature: function( feature )
Allow for multiple selected features based on multiple property and multipleKey event modifier.
multipleSelect: function()
Event should toggle the selected state of a feature based on toggle property and toggleKey event modifier.
toggleSelect: function()
Called on click outside a previously clicked (selected) feature.
clickoutFeature: function( feature )
Called on over a feature.
overFeature: function( feature )
Called on out of a selected feature.
outFeature: function( feature )
Add feature to the layer’s selectedFeature array, render the feature as selected, and call the onSelect function.
select: function( feature )
Remove feature from the layer’s selectedFeature array, render the feature as normal, and call the onUnselect function.
unselect: function( feature )
Set the map property for the control.
setMap: function( map )