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

Classes

AbstractDatasource
ClientSideDatasource
ServerSideDatasource

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 inherited overrides

Destroys the plugin

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)

Changes the current node

Name Type Description
nodeId string

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>
#0055aa
hoverColor string <optional>
#aa5500
opacity number <optional>
0.8
scale Array.<number> <optional>
[0.5,2]

Function to load the links of a node

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

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

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

additional markers to use on this 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>
getLinks PSV.plugins.VirtualTourPlugin.GetLinks <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

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

linksOnCompass boolean <optional>

if the Compass plugin is enabled, displays the links on the compass

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