ol. ol.Observable

new Observable

Stability: experimental

An event target providing convenient methods for listener registration and unregistration.

Source:
  • observable.js, line 18

Methods

dispatchChangeEvent

Stability: experimental
Source:
  • observable.js, line 35

on

Stability: experimental

Listen for a certain type of event.

Parameters:
Name Type Argument 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.

Source:
  • observable.js, line 58
Returns:

Unique key for the listener.

Type
goog.events.Key

once

Stability: experimental

Listen once for a certain type of event.

Parameters:
Name Type Argument 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.

Source:
  • observable.js, line 71
Returns:

Unique key for the listener.

Type
goog.events.Key

un

Stability: experimental

Unlisten for a certain type of event.

Parameters:
Name Type Argument 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.

Source:
  • observable.js, line 83

unByKey

Stability: experimental

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

Parameters:
Name Type Description
key goog.events.Key

Key.

Source:
  • observable.js, line 93