Skip to main content

ViewChangeEvent

Since version 4.0.0

An event that fires on camera view direction change.
This is triggered only on frame render.
In other words, even if the actual camera orientation changes several times between frame renderings, the actual event is triggered only with the camera's direction at the time the screen is updated.

interface ViewChangeEvent

Properties

Camera's new pitch value.

Camera's new quaternion value. (x, y, z, w)

An instance of the component that triggered this event.

A type of the event.
This value is equal to event's name.

Camera's new yaw value.

Camera's new zoom value.

Properties

pitch

>=4.0.0
pitch

number

Camera's new pitch value.

quaternion

>=4.0.0
quaternion

number[]

Camera's new quaternion value. (x, y, z, w)

target

>=4.0.0
target

View360

An instance of the component that triggered this event.

Example
viewer.on("ready", evt => {
console.log(evt.target); // = viewer
});

type

>=4.0.0
type

string

A type of the event.
This value is equal to event's name.

Example
viewer.on("ready", evt => {
console.log(evt.type); // "ready"
});

yaw

>=4.0.0
yaw

number

Camera's new yaw value.

zoom

>=4.0.0
zoom

number

Camera's new zoom value.