Namespace: PSV

PSV

Classes

Animation

Interpolation helper for animations

Dynamic

Represents a variable that can dynamically change with time (using requestAnimationFrame)

DynamicXD

Implementation of PSV.Dynamic for any number of variables, unused

MultiDynamic

Wrapper for multiple PSV.Dynamic evolving together

PSVError

Custom error used in the lib

Viewer

Main class

Namespaces

adapters
buttons
components
constants
plugins
services
utils

Members

PSV.DEFAULTS PSV.Options staticconstant

Default options

PSV.SYSTEM staticconstant

General information about the system

Properties:
Name Type Description
loaded boolean

Indicates if the system has been loaded yet

load function

Loads the system if not already loaded

pixelRatio number
isWebGLSupported boolean
maxCanvasWidth number
mouseWheelEvent string
fullscreenEvent string
getMaxCanvasWidth function

Returns the max width of a canvas allowed by the browser

isTouchEnabled Promise.<boolean>

Methods

PSV.registerButton (button) static

Register a new button available for all viewers

Name Type Description
button Class.<PSV.buttons.AbstractButton>

Type Definitions

PSV.AnimateOptions PSV.ExtendedPosition

Object defining animation options

Properties:
Name Type Argument Description
speed number | string

animation speed or duration (in milliseconds)

zoom number <optional>

new zoom level between 0 and 100

PSV.ClickData Object

Data of the click event

Properties:
Name Type Argument Description
rightclick boolean

if it's a right click

clientX number

position in the browser window

clientY number

position in the browser window

viewerX number

position in the viewer

viewerY number

position in the viewer

longitude number

position in spherical coordinates

latitude number

position in spherical coordinates

textureX number <optional>

position on the texture, undefined for cubemaps

textureY number <optional>

position on the texture, undefined for cubemaps

marker PSV.plugins.MarkersPlugin.Marker <optional>

clicked marker

PSV.CssSize Object

Object defining a size in CSS (px, % or auto)

Properties:
Name Type Argument Description
width string <optional>
height string <optional>

PSV.ExtendedPosition PSV.Position

Object defining a spherical or texture position

A position that can be expressed either in spherical coordinates (radians or degrees) or in texture coordinates (pixels)

Properties:
Name Type Argument Description
longitude number <optional>
latitude number <optional>
x number <optional>
y number <optional>

PSV.NavbarCustomButton Object

Definition of a custom navbar button

Properties:
Name Type Argument Default Description
id string <optional>
title string <optional>
content string <optional>
className string <optional>
onClick function
disabled boolean <optional>
false
visible boolean <optional>
true
collapsable boolean <optional>
true

PSV.Options Object

Viewer options, see http://photo-sphere-viewer.js.org/guide/config.html

PSV.PanoData Object

Crop information of the panorama

Properties:
Name Type Description
fullWidth number
fullHeight number
croppedWidth number
croppedHeight number
croppedX number
croppedY number
poseHeading number
posePitch number
poseRoll number

PSV.PanoDataProvider (image)PSV.PanoData

Function to compute panorama data once the image is loaded

Name Type Description
image Image

loaded image

Returns:
Type Description
PSV.PanoData computed panorama data

PSV.PanoramaOptions PSV.ExtendedPosition

Object defining panorama and animation options

Properties:
Name Type Argument Default Description
transition boolean | number <optional>
1500

duration of the transition between all and new panorama

showLoader boolean <optional>
true

show the loader

zoom number <optional>

new zoom level between 0 and 100

sphereCorrection PSV.SphereCorrection <optional>

new sphere correction to apply to the panorama

panoData PSV.PanoData | PSV.PanoDataProvider <optional>

new data used for this panorama

PSV.Point Object

Object defining a point

Properties:
Name Type Description
x number
y number

PSV.Position Object

Object defining a spherical position

Properties:
Name Type Description
longitude number
latitude number

PSV.Size Object

Object defining a size

Properties:
Name Type Description
width number
height number

PSV.SphereCorrection Object

Properties:
Name Type Description
pan number
tilt number
roll number

PSV.TextureData Object

Result of the PSV.adapters.AbstractAdapter#loadTexture method

Properties:
Name Type Argument Description
texture external:THREE.Texture | Array.<external:THREE.Texture> | Record.<string, Array.<external:THREE.Texture>>
panoData PSV.PanoData <optional>

Events

PSV.event:autorotate

Triggered when the automatic rotation is enabled/disabled

Name Type Description
enabled boolean

PSV.event:before-render

Triggered before a render, used to modify the view

Name Type Description
timestamp number

time provided by requestAnimationFrame

elapsed number

time elapsed from the previous frame

PSV.event:before-rotate

Triggered before a rotate operation, can be cancelled

Type Description
PSV.ExtendedPosition

PSV.event:click

Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)

Name Type Description
data PSV.ClickData

PSV.event:close-panel

Triggered when the panel is closed

Name Type Description
id string optional

PSV.event:config-changed

Triggered after a call to setOption/setOptions

Name Type Description
name Array.<string>

of changed options

PSV.event:dblclick

Triggered when the user double clicks on the viewer. The simple click event is always fired before dblclick

Name Type Description
data PSV.ClickData

PSV.event:fullscreen-updated

Triggered when the fullscreen mode is enabled/disabled

Name Type Description
enabled boolean

PSV.event:get-animate-position

Called to alter the target position of an animation

Name Type Description
position Position
Returns:
Type Description
Position

PSV.event:get-rotate-position

Called to alter the target position of a rotation

Name Type Description
position Position
Returns:
Type Description
Position

PSV.event:hide-notification

Triggered when the notification is hidden

PSV.event:hide-overlay

Triggered when the overlay is hidden

Name Type Description
id string optional

PSV.event:hide-tooltip

Triggered when the tooltip is hidden

Name Type Description
Data *

associated to this tooltip

PSV.event:open-panel

Triggered when the panel is opened

Name Type Description
id string optional

PSV.event:panorama-loaded

Triggered when a panorama image has been loaded

PSV.event:position-updated

Triggered when the view longitude and/or latitude changes

Name Type Description
position PSV.Position

PSV.event:ready

Triggered when the panorama image has been loaded and the viewer is ready to perform the first render

PSV.event:render

Triggered on each viewer render, this event is triggered very often

PSV.event:show-notification

Triggered when the notification is shown

PSV.event:show-overlay

Triggered when the overlay is shown

Name Type Description
id string optional

PSV.event:show-tooltip

Triggered when the tooltip is shown

Name Type Description
Data *

associated to this tooltip

Instance PSV.components.Tooltip

of the tooltip

PSV.event:size-updated

Triggered when the viewer size changes

Name Type Description
size PSV.Size

PSV.event:stop-all

Triggered when all current animations are stopped

PSV.event:zoom-updated

Triggered when the zoom level changes

Name Type Description
zoomLevel number