Class: GyroscopePlugin

PSV.plugins.GyroscopePlugin

new PSV.plugins.GyroscopePlugin (psv, options)

Adds gyroscope controls on mobile devices

Name Type Description
psv PSV.Viewer
options PSV.plugins.GyroscopePlugin.Options

Extends

Members

PSV.plugins.GyroscopePlugin.EVENTS string staticconstant

Available events

id string readonly inherited overrides

Unique identifier of the plugin

Reference to main controller

Methods

destroy () package overrides

init () package overrides

isEnabled ()boolean

Checks if the gyroscope is enabled

Returns:
Type Description
boolean

start ()Promise

Enables the gyroscope navigation if available

Fires:
Throws:

if the gyroscope API is not available/granted

Type
PSV.PSVError
Returns:
Type Description
Promise

stop ()

Disables the gyroscope navigation

Fires:

toggle ()

Enables or disables the gyroscope navigation

Type Definitions

PSV.plugins.GyroscopePlugin.Options Object

Properties:
Name Type Argument Default Description
touchmove boolean <optional>
true

allows to pan horizontally when the gyroscope is enabled (requires global mousemove=true)

absolutePosition boolean <optional>
false

when true the view will ignore the current direction when enabling gyroscope control

moveMode 'smooth' | 'fast' <optional>
'smooth'

How the gyroscope data is used to rotate the panorama.

Events

PSV.plugins.GyroscopePlugin.event:gyroscope-updated

Triggered when the gyroscope mode is enabled/disabled

Name Type Description
enabled boolean