addEventListener
Adds an event listener to the viewer instance.
Example
Usage
const eventCallback = (event) => {
console.log(event);
};
const listener = viewer3d.addEventListener("eventName", eventCallback);Parameters
eventName
Name of the viewer event to listen for.
Valid event names can be found in each Event page.
Type | Required |
|---|---|
String | Yes |
eventCallback
Function invoked when the event is triggered. The function receives an event object as an argument which includes data specific to the event type.
Type | Required |
|---|---|
(event: Object) => Void | Yes |
Return Value
The event listener object.
Type |
|---|
Object |
Properties
Name | Type | Description |
|---|---|---|
remove | () => Void | Removes the event listener |