Skip to main content

View360Options

Since version 4.0.0

Options for View360

interface View360Options extends CameraOptions, PanoControlOptions

Extends

Properties

Disable context menu which pops up on mouse right click.

Camera's horizontal FOV(Field of View). (in degrees, °)

Options for GyroControl.
false to disable gyroscope control.

Initial pitch (x-axis rotation) value for camera. (in degrees, °)
As View360 uses right-handed coordinate system internally, positive value will make camera to look upside, while negative value will look down.

Initial yaw (y-axis rotation) value for camera. (in degrees, °)
As View360 uses right-handed coordinate system internally, camera will rotate counter-clockwise by this value.

Initial zoom value for camera.
Setting this value to 2 will enlarge panorama 200% by width.

Restrict pitch(x-axis rotation) range. (in degrees, °)

Options for RotateControl.
false to disable rotation.

If true, enables scroll on mobile(touch) devices on canvas.

caution

When this option is enabled, users must swipe horizontally first then vertically to change view up or down.

Apply CSS cursor by current state of input when using mouse.
If true, this will add CSS style to canvas element. It'll apply cursor: "grab" by default and cursor: "grabbing" when holding the mouse button.

If true, enables scroll by mouse wheel on canvas.

caution

When this option is enabled, zoom by mouse wheel will be disabled.

Restrict yaw(y-axis rotation) range. (in degrees, °)

Options for ZoomControl.
false to disable zoom.

Restrict camera zoom range.
If null, a default zoom range from 0.6 to 10 will be used.

Properties

autoInit

autoInit

boolean

autoResize

autoResize

boolean

autoplay

autoplay

boolean | Partial<AutoplayOptions>

canvasSelector

canvasSelector

string

debug

debug

boolean

disableContextMenu

>=4.0.0
inherited
disableContextMenu

boolean

false

Disable context menu which pops up on mouse right click.

fov

>=4.0.0
inherited
fov

number

90

Camera's horizontal FOV(Field of View). (in degrees, °)

Example
// Init with fov: 120
const viewer = new View360("#el_id", { fov: 120 });

// Back to 90
viewer.fov = 90;

gyro

>=4.0.0
inherited
gyro

boolean | Partial<GyroControlOptions>

Options for GyroControl.
false to disable gyroscope control.

hotspot

hotspot

Partial<HotspotOptions>

initialPitch

>=4.0.0
inherited
initialPitch

number

0

Initial pitch (x-axis rotation) value for camera. (in degrees, °)
As View360 uses right-handed coordinate system internally, positive value will make camera to look upside, while negative value will look down.

Example
const viewer = new View360("#el_id", {
initialPitch: 60
});

viewer.on("ready", () => {
console.log(viewer.camera.pitch); // 60
});

initialYaw

>=4.0.0
inherited
initialYaw

number

0

Initial yaw (y-axis rotation) value for camera. (in degrees, °)
As View360 uses right-handed coordinate system internally, camera will rotate counter-clockwise by this value.

Example
const viewer = new View360("#el_id", {
initialYaw: 30
});

viewer.on("ready", () => {
console.log(viewer.camera.yaw); // 30
});

initialZoom

>=4.0.0
inherited
initialZoom

number

1

Initial zoom value for camera.
Setting this value to 2 will enlarge panorama 200% by width.

Example
const viewer = new View360("#el_id", {
initialZoom: 2
});

viewer.on("ready", () => {
console.log(viewer.camera.zoom); // 2
});

maxDeltaTime

maxDeltaTime

number

on

on

Partial<{ beforeRender: ((evt: BeforeRenderEvent) => any); inputEnd: ((evt: InputEndEvent) => any); inputStart: ((evt: InputStartEvent) => any); load: ((evt: LoadEvent) => any); loadStart: ((evt: LoadStartEvent) => any); projectionChange: ((evt: ProjectionChangeEvent) => any); ready: ((evt: ReadyEvent) => any); render: ((evt: RenderEvent) => any); resize: ((evt: ResizeEvent) => any); staticClick: ((evt: StaticClickEvent) => any); viewChange: ((evt: ViewChangeEvent) => any); vrEnd: ((evt: VREndEvent) => any); vrStart: ((evt: VRStartEvent) => any) }>

pitchRange

>=4.0.0
inherited
pitchRange

null | Range

null

Restrict pitch(x-axis rotation) range. (in degrees, °)

Example
const viewer = new View360("#el_id", {
pitchRange: [-45, 45]
});

viewer.on("ready", () => {
console.log(viewer.camera.pitch); // 0
viewer.camera.lookAt({ pitch: 60 });
console.log(viewer.camera.pitch); // 45
});

plugins

plugins

View360Plugin[]

projection

projection

null | Projection

rotate

>=4.0.0
inherited
rotate

boolean | Partial<RotateControlOptions>

Options for RotateControl.
false to disable rotation.

scrollable

>=4.0.0
inherited
scrollable

boolean

true

If true, enables scroll on mobile(touch) devices on canvas.

caution

When this option is enabled, users must swipe horizontally first then vertically to change view up or down.

tabIndex

tabIndex

null | number

useGrabCursor

>=4.0.0
inherited
useGrabCursor

boolean

true

Apply CSS cursor by current state of input when using mouse.
If true, this will add CSS style to canvas element. It'll apply cursor: "grab" by default and cursor: "grabbing" when holding the mouse button.

useResizeObserver

useResizeObserver

boolean

wheelScrollable

>=4.0.0
inherited
wheelScrollable

boolean

false

If true, enables scroll by mouse wheel on canvas.

caution

When this option is enabled, zoom by mouse wheel will be disabled.

yawRange

>=4.0.0
inherited
yawRange

null | Range

Restrict yaw(y-axis rotation) range. (in degrees, °)

Example
const viewer = new View360("#el_id", {
yawRange: [-30, 30]
});

viewer.on("ready", () => {
console.log(viewer.camera.yaw); // 0
viewer.camera.lookAt({ yaw: 60 });
console.log(viewer.camera.yaw); // 30
});

zoom

>=4.0.0
inherited
zoom

boolean | Partial<ZoomControlOptions>

Options for ZoomControl.
false to disable zoom.

zoomRange

>=4.0.0
inherited
zoomRange

null | Range

null

Restrict camera zoom range.
If null, a default zoom range from 0.6 to 10 will be used.

Example
const viewer = new View360("#el_id", {
zoomRange: [0.5, 4]
});

viewer.on("ready", () => {
console.log(viewer.camera.zoom); // 1
viewer.camera.lookAt({ zoom: 6 });
console.log(viewer.camera.zoom); // 4
});