# Class: Select

## ol.interaction.Select

Handles selection of vector data.

#### new ol.interaction.Select(opt_options) experimental

src/ol/interaction/selectinteraction.js, line 26

  Name | Type | Description
  --- | --- | ---
  `options` | optional Options.
  Name | Type | Description
  --- | --- | ---
  `addCondition` | ol.events.ConditionType | undefined | optional 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 | optional 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 | optional FeatureOverlay style.
  `removeCondition` | ol.events.ConditionType | undefined | optional 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 | optional 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.

### Extends

- ol.interaction.Interaction

### Methods

#### dispatchChangeEvent() inherited experimental

src/ol/observable.js, line 41

  Dispatches a `change` event.

  ##### Fires:

  - `change` experimental

#### getFeatures(){ol.Collection} experimental

src/ol/interaction/selectinteraction.js, line 108

  ##### Returns:

  Features collection.

#### on(type, listener, opt_this){goog.events.Key} inherited experimental

src/ol/observable.js, line 63

  Listen for a certain type of event.

  Name | Type | Description
  --- | --- | ---
  `type` | string | Array.<string> | The event type or array of event types.
  `listener` | function | The listener function.
  `this` | Object | optional The object to use as `this` in `listener`.

  ##### Returns:

  Unique key for the listener.

#### once(type, listener, opt_this){goog.events.Key} inherited experimental

src/ol/observable.js, line 76

  Listen once for a certain type of event.

  Name | Type | Description
  --- | --- | ---
  `type` | string | Array.<string> | The event type or array of event types.
  `listener` | function | The listener function.
  `this` | Object | optional The object to use as `this` in `listener`.

  ##### Returns:

  Unique key for the listener.

#### setMap(map) experimental

src/ol/interaction/selectinteraction.js, line 181

  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.

  Name | Type | Description
  --- | --- | ---
  `map` | ol.Map | Map.

#### un(type, listener, opt_this) inherited experimental

src/ol/observable.js, line 88

  Unlisten for a certain type of event.

  Name | Type | Description
  --- | --- | ---
  `type` | string | Array.<string> | The event type or array of event types.
  `listener` | function | The listener function.
  `this` | Object | optional The object to use as `this` in `listener`.

#### unByKey(key) inherited experimental

src/ol/observable.js, line 98

  Removes an event listener using the key returned by `on()` or `once()`.

  Name | Type | Description
  --- | --- | ---
  `key` | goog.events.Key | Key.