ol.interaction. ol.interaction.Select

new Select

Stability: experimental
Parameters:
Name Type Argument Description
options olx.interaction.SelectOptions <optional>

Options.

Properties
Name Type Description
addCondition ol.events.ConditionType | undefined

A conditional modifier (e.g. alt key) that determines if the feature is added to the current selection. By default, this is never. Note that the default toggle condition allows features to be added.

condition ol.events.ConditionType | undefined

A conditional modifier (e.g. shift key) that determines if the interaction is active (i.e. selection occurs) or not. By default, a click with no modifier keys toggles the selection.

layers Array.<ol.layer.Layer> | function

A list of layers from which features should be selected. Alternatively, a filter function can be provided. The function will be called for each layer in the map and should return true for layers that you want to be selectable. If the option is absent, all visible layers will be considered selectable.

style ol.style.Style | Array.<ol.style.Style> | ol.feature.StyleFunction | undefined

FeatureOverlay style.

removeCondition ol.events.ConditionType | undefined

A conditional modifier (e.g. alt key) that determines if the feature is removed from the current selection. By default, this is never.

toggleCondition ol.events.ConditionType | undefined

A conditional modifier (e.g. shift key) that determines if the selection is toggled in the current selection. By default, a shift-click toggles the feature in the current selection.

Source:
  • selectinteraction.js, line 23

Extends

  • ol.interaction.Interaction

Methods

getFeatures

Stability: experimental
Source:
  • selectinteraction.js, line 105
Returns:

Features collection.

Type
ol.Collection

setMap

Stability: experimental

Remove the interaction from its current map, if any, and attach it to a new map, if any. Pass null to just remove the interaction from the current map.

Parameters:
Name Type Description
map ol.Map

Map.

Source:
  • selectinteraction.js, line 178