Creates a new panorama renderer.
Parameters
container
HTMLElement The container element for the renderer.image
Image or Array or Object Input image; format varies based on
imageType
. For equirectangular
, this is an image; for cubemap
,
this is an array of images for the cube faces in the order [+z, +x, -z,
-x, +y, -y]; for multires
, this is a configuration object.imageType
string The type of the image: equirectangular
,
cubemap
, or multires
.dynamic
boolean Whether or not the image is dynamic (e.g. video).Destroy renderer.
Retrieve renderer’s canvas.
Returns HTMLElement Renderer’s canvas.
Initialize renderer.
Parameters
haov
number Initial horizontal angle of view.vaov
number Initial vertical angle of view.voffset
number Initial vertical offset angle.callback
function Load callback function.Check if images are loading.
Returns boolean Whether or not images are loading.
Render new view of panorama.
Parameters
pitch
number Pitch to render at.yaw
number Yaw to render at.hfov
number Horizontal field of view to render with.returnImage
boolean Return rendered image?Resize renderer (call after resizing container).
Creates a new panorama viewer.
Parameters
container
HTMLElement or string The container (div) element for the
viewer, or its ID.initialConfig
Object Inital configuration for viewer.Returns the horizontal field of view.
Returns number Horizontal field of view in degrees
Returns the minimum and maximum allowed horizontal fields of view (in degrees).
Returns Array<number> [minimum hfov, maximum hfov]
Returns the pitch of the center of the view.
Returns number Pitch in degrees
Returns the minimum and maximum allowed pitches (in degrees).
Returns Array<number> [minimum pitch, maximum pitch]
Returns the panorama renderer.
Returns Renderer
Returns the yaw of the center of the view.
Returns number Yaw in degrees
Returns the minimum and maximum allowed pitches (in degrees).
Returns Array<number> [yaw pitch, maximum yaw]
Calculate panorama pitch and yaw from location of mouse event.
Parameters
event
MouseEvent Document mouse down event.Returns Array<number> [pitch, yaw]
Sets the horizontal field of view.
Parameters
hfov
number Horizontal field of view in degreesReturns Viewer this
Set the minimum and maximum allowed horizontal fields of view (in degrees).
Parameters
bounds
Array<number> [minimum hfov, maximum hfov]Returns Viewer this
Sets the pitch of the center of the view.
Parameters
pitch
number Pitch in degreesReturns Viewer this
Set the minimum and maximum allowed pitches (in degrees).
Parameters
bounds
Array<number> [minimum pitch, maximum pitch]Returns Viewer this
Sets update flag for dynamic content.
Parameters
bool
boolean Whether or not viewer should update even when stillReturns Viewer this
Sets the yaw of the center of the view.
Parameters
yaw
number Yaw in degreesReturns Viewer this
Set the minimum and maximum allowed yaws (in degrees).
Parameters
bounds
Array<number> [minimum yaw, maximum yaw]Returns Viewer this
Pannellum is developed on GitHub by Matthew Petroff.