Namespace: PSV

PSV

Classes

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 data has been loaded

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 Object

Methods

PSV.registerButton (button, defaultPosition) static

Register a new button available for all viewers

Name Type Description
button Class.<PSV.buttons.AbstractButton>
defaultPosition 'start' | 'end' | '[id]:left' | '[id]:right' optional

If provided the default configuration of the navbar will be modified.

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, if applicable

textureY number <optional>

position on the texture, if applicable

marker PSV.plugins.MarkersPlugin.Marker <optional>

clicked marker

objects Array.<THREE.Object3D> <optional>
target EventTarget <optional>

PSV.CssSize Object

Object defining a size in CSS

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

PSV.ExtendedPosition PSV.Position | PSV.Point

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)

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
tabbable boolean <optional>
true

PSV.Options Object

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

PSV.PanoData Object

Crop information of the panorama

Properties:
Name Type Argument Description
fullWidth number
fullHeight number
croppedWidth number
croppedHeight number
croppedX number
croppedY number
poseHeading number <optional>
posePitch number <optional>
poseRoll number <optional>

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
caption string <optional>

new navbar caption

description string <optional>

new panel description

transition boolean | number <optional>
1500

duration of the transition between all and new panorama

showLoader boolean <optional>
true

show the loader while loading the new panorama

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

overlay * <optional>

new overlay to apply to the panorama

overlayOpacity number <optional>

new overlay opacity

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

Object defining angular corrections to a sphere

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
panorama *
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

Name Type Description
id string optional

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:key-press

Triggered when a key is pressed, can be cancelled

Name Type Description
key string

PSV.event:load-progress

Triggered when the loader value changes

Name Type Description
value number

from 0 to 100

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

Name Type Description
textureData PSV.TextureData

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

Name Type Description
id string optional

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