Maps SDK for Web

tt.Evented

Map (and some other classes) emit events in response to user interactions or changes in state. Evented is the interface used to bind and unbind listeners for these events.

Methods

off(type, listener): Object

Removes a previously registered event listener.

Parameters
Name Description
type
String
default:None
The event type to remove listeners.
listener
Function
default:None
The listener function to remove.
Returns

this

on(type, listener): Object

Adds a listener to a specified event type.

Parameters
Name Description
type
String
default:None
The event type to add a listen for.
listener
Function
default:None
The function to be called when the event is fired. The listener function is called with the data object passed to fire, extended with the target and type properties.
Returns

this

once(type, listener): Object

Adds a listener that will be called only once to a specified event type. The listener will be called the first time the event fires after the listener is registered.

Parameters
Name Description
type
String
default:None
The event type to listen for.
listener
Function
default:None
The function to be called when the event is fired the first time.
Returns

this