Standard options
HTML element which will contain the panorama, or an identifier string targeting the element.
Path to the panorama. Must be a single URL when using the default equirectangular adapter. Other adapters support different value shapes.
List of enabled plugins. Each entry is either a plugin constructor or a tuple of
[PluginConstructor, options].Text displayed in the navbar. HTML is allowed. Has no visible effect when the navbar is disabled.
Text displayed in the side panel when the user clicks the “i” button. HTML is allowed.
File that will be downloaded when the user clicks the download button. Particularly useful for adapters that use multiple files, such as the CubemapAdapter or EquirectangularTilesAdapter.
Overrides the filename used when downloading the panorama. Mainly useful when the panorama is provided as a base64 string.
Final size of the panorama container. By default the size of
container is used and followed when the element is resized.Configuration of the navbar.
Minimal field of view (maximum zoom level). Must be between
1 and maxFov.Maximal field of view (minimum zoom level). Must be between
minFov and 180.Initial zoom level, between
0 (for maxFov) and 100 (for minFov).Enables the fisheye effect. Pass
true (equivalent to strength 1.0) or a numeric strength value.Initial horizontal angle, between
0 and 2π.Initial vertical angle, between
-π/2 and π/2.Various text strings used throughout the viewer. Override any key to translate or customise the UI.
Path to an image displayed in the centre of the loader.
Text displayed in the centre of the loader. Only used when
loadingImg is not set.Enables zoom with the mouse wheel.
Enables panorama rotation with click-and-drag or a finger swipe on touch screens.
Enables keyboard controls.
'fullscreen' (same as true) activates controls only while in fullscreen mode. 'always' activates controls at all times.Requires holding Ctrl to zoom with the mouse wheel. This lets users scroll the page without accidentally zooming the viewer. When Ctrl is not held, an overlay prompt is shown.
Requires two fingers to rotate the panorama on touch screens, allowing standard single-finger page scrolling. When only one finger is detected, an overlay prompt is shown.
Advanced options
sphereCorrection
{ pan: double | string, tilt: double | string, roll: double | string }
default:"{ pan: 0, tilt: 0, roll: 0 }"
Corrects the panorama orientation. If the panorama file contains XMP pose data (heading/pitch/roll), those values are applied before
sphereCorrection.Overrides XMP data found in the panorama file. All sub-fields are optional.
- Static object
- Dynamic function
Default transition used when switching between panoramas. All fields can be overridden per call to
setPanorama().effect:'fade','black', or'white'speed: duration in milliseconds, or a string with revolutions per minute (e.g.'2rpm')rotation: whether to animate camera rotation during the transition
Speed multiplier for panorama movement (click-drag, touch swipe, and navbar move buttons).
Speed multiplier for panorama zoom (mouse wheel, touch pinch, and navbar zoom buttons).
Applies damping to camera movement. Higher values mean stronger damping. Pass
false to disable, or true to use the default damping factor.HTTP headers sent when loading image files.
- Static headers
- Dynamic function
Send credentials with HTTP requests.
Maps key codes to viewer actions. The key can include modifiers (You can also assign an arbitrary callback. It receives the viewer instance and the original keyboard event.
Ctrl, Shift, Alt, Meta) separated by +.Background of the WebGL canvas, visible when using cropped panoramas. Accepts any valid CSS
background value.Configuration passed directly to the Three.js
WebGLRenderer. See the Three.js docs for available options.Cache
Photo Sphere Viewer includes a global cache shared across all viewer instances. It saves resources when switching back and forth between multiple panoramas.This cache is unrelated to the Three.js internal cache, which should remain disabled.
Set to
false to completely disable the cache.Maximum retention duration in minutes.
Maximum number of items stored. Note that cubemap and tile adapters store multiple files per panorama, so the actual file count may be higher.
