Class: VirtualTourPlugin

PSV.plugins.VirtualTourPlugin

new PSV.plugins.VirtualTourPlugin (psv, options)

Create virtual tours by linking multiple panoramas

Name Type Description
psv PSV.Viewer
options PSV.plugins.VirtualTourPlugin.Options optional

Extends

Members

PSV.plugins.VirtualTourPlugin.EVENTS string staticconstant

Available events

PSV.plugins.VirtualTourPlugin.MODE_3D string staticconstant

PSV.plugins.VirtualTourPlugin.MODE_CLIENT string staticconstant

In client mode all the nodes are provided in the config or with the setNodes method

PSV.plugins.VirtualTourPlugin.MODE_GPS string staticconstant

In GPS mode each node is globally positionned and the links are automatically computed

PSV.plugins.VirtualTourPlugin.MODE_MANUAL string staticconstant

In manual mode each link is positionned manually on the panorama

PSV.plugins.VirtualTourPlugin.MODE_MARKERS string staticconstant

PSV.plugins.VirtualTourPlugin.MODE_SERVER string staticconstant

In server mode the nodes are fetched asynchronously

id string readonly inherited overrides

Unique identifier of the plugin

Reference to main controller

Methods

destroy () package overrides

init () package overrides

is3D ()boolean

Tests if running in 3D mode

Returns:
Type Description
boolean

isGps ()boolean

Tests if running in GPS mode

Returns:
Type Description
boolean

isServerSide ()boolean

Tests if running in server mode

Returns:
Type Description
boolean

setCurrentNode (nodeId, fromLink)Promise.<boolean>

Changes the current node

Name Type Default Description
nodeId string
fromLink PSV.plugins.VirtualTourPlugin.NodeLink null optional
Returns:
Type Description
Promise.<boolean> resolves false if the loading was aborted by another call

setNodes (nodes, startNodeId)

Sets the nodes (client mode only)

Name Type Description
nodes Array.<PSV.plugins.VirtualTourPlugin.Node>
startNodeId string optional
Throws:

when the configuration is incorrect

Type
PSV.PSVError

Type Definitions

PSV.plugins.VirtualTourPlugin.ArrowStyle Object

Style of the arrow in 3D mode

Properties:
Name Type Argument Default Description
color string <optional>
0xaaaaaa
hoverColor string <optional>
0xaa5500
outlineColor number <optional>
0x000000
scale Array.<number> <optional>
[0.5,2]

PSV.plugins.VirtualTourPlugin.GetNode (nodeId)PSV.plugins.VirtualTourPlugin.Node | Promise.<PSV.plugins.VirtualTourPlugin.Node>

Function to load a node

Name Type Description
nodeId string
Returns:
Type Description
PSV.plugins.VirtualTourPlugin.Node | Promise.<PSV.plugins.VirtualTourPlugin.Node>

PSV.plugins.VirtualTourPlugin.Node Object

Definition of a single node in the tour

Properties:
Name Type Argument Description
id string

unique identifier of the node

panorama *
links Array.<PSV.plugins.VirtualTourPlugin.NodeLink> <optional>

links to other nodes

position Array.<number> <optional>

GPS position (longitude, latitude, optional altitude)

panoData PSV.PanoData | PSV.PanoDataProvider <optional>

data used for this panorama

sphereCorrection PSV.SphereCorrection <optional>

sphere correction to apply to this panorama

name string <optional>

short name of the node

caption string <optional>

caption visible in the navbar

description string <optional>

description visible in the side panel

thumbnail string <optional>

thumbnail for the gallery

markers Array.<PSV.plugins.MarkersPlugin.Properties> <optional>

additional markers to use on this node

PSV.plugins.VirtualTourPlugin.NodeChangedData Object

Data associated to the "node-changed" event

[fromNode] - The previous node

Definition of a link between two nodes

Properties:
Name Type Argument Description
nodeId string

identifier of the target node

name string <optional>

override the name of the node (tooltip)

position Array.<number> <optional>

override the GPS position of the node

markerStyle PSV.plugins.MarkersPlugin.Properties <optional>

override global marker style

arrowStyle PSV.plugins.VirtualTourPlugin.ArrowStyle <optional>

override global arrow style

PSV.plugins.VirtualTourPlugin.Options Object

Properties:
Name Type Argument Default Description
dataMode 'client' | 'server' <optional>
'client'

configure data mode

positionMode 'manual' | 'gps' <optional>
'manual'

configure positioning mode

renderMode 'markers' | '3d' <optional>
'3d'

configure rendering mode of links

nodes Array.<PSV.plugins.VirtualTourPlugin.Node> <optional>

initial nodes

getNode PSV.plugins.VirtualTourPlugin.GetNode <optional>
startNodeId string <optional>

id of the initial node, if not defined the first node will be used

preload boolean | PSV.plugins.VirtualTourPlugin.Preload <optional>
false

preload linked panoramas

rotateSpeed boolean | string | number <optional>
'20rpm'

speed of rotation when clicking on a link, if 'false' the viewer won't rotate at all

transition boolean | number <optional>
1500

duration of the transition between nodes

linksOnCompass boolean <optional>

if the Compass plugin is enabled, displays the links on the compass, defaults to true on in markers render mode

markerStyle PSV.plugins.MarkersPlugin.Properties <optional>

global marker style

arrowStyle PSV.plugins.VirtualTourPlugin.ArrowStyle <optional>

global arrow style

markerLatOffset number <optional>
-0.1

(GPS & Markers mode) latitude offset applied to link markers, to compensate for viewer height

arrowPosition 'top' | 'bottom' <optional>
'bottom'

(3D mode) arrows vertical position

PSV.plugins.VirtualTourPlugin.Preload (node, link)boolean

Function to determine if a link must be preloaded

Name Type Description
node PSV.plugins.VirtualTourPlugin.Node
link PSV.plugins.VirtualTourPlugin.NodeLink
Returns:
Type Description
boolean

Events

PSV.plugins.VirtualTourPlugin.event:node-changed

Triggered when the current node changes

Name Type Description
nodeId string

PSV.plugins.VirtualTourPlugin.event:node-changed

Triggered when the current node is changed

Name Type Description
nodeId string
data PSV.plugins.VirtualTourPlugin.NodeChangedData