Class: Select

ol.interaction. Select

experimental new ol.interaction.Select(opt_options)

Name Type Argument Description
options optional

Options.

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.

Fires:
  • change

Extends

Methods

experimental inherited dispatchChangeEvent()

Dispatches a change event. Register a listener for this event to get notified of changes.

Fires:
  • change
Returns:
collection.

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

Listen for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

Returns:
key for the listener.

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

Listen once for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

Returns:
key for the listener.

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.

experimental inherited un(type, listener, opt_this)

Unlisten for a certain type of event.

Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>
optional

The object to use as this in listener.

experimental inherited unByKey(key)

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

Name Type Description
key goog.events.Key

Key.