new PSVHUD( psv )

Description

HUD class

Parameters
Name Type Description
psv PhotoSphereViewer

Members


<readonly> container :HTMLElement

Details
HTMLElement

<readonly> currentMarker :PSVMarker

Last selected marker

Details

<readonly> hoveringMarker :PSVMarker

Marker under the cursor

Details

markers :Object.<string, PSVMarker>

All registered markers

Details
Object.<string, PSVMarker>

<readonly> parent :PhotoSphereViewer|module:components.PSVComponent


<readonly> psv :PhotoSphereViewer


<readonly> svgContainer :SVGElement

Details
SVGElement

Methods


addMarker( properties [, render ] ) → {PSVMarker}

Adds a new marker to viewer

Parameters
Name Type Attributes Default Description
properties Object

see http://photo-sphere-viewer.js.org/markers.html#config

render boolean <optional>
true

renders the marker immediately

Returns
Throws

when the marker's id is missing or already exists


clearMarkers( [ render ] )

Removes all markers

Parameters
Name Type Attributes Default Description
render boolean <optional>
true

renders the markers immediately


<protected> create()

Creates the component


<protected> destroy()

Destroys the component


getCurrentMarker() → {PSVMarker}

Returns the last marker selected by the user

Returns

getMarker( markerId ) → {PSVMarker}

Returns the internal marker object for a marker id

Parameters
Name Type Description
markerId *
Returns
Throws

when the marker cannot be found


gotoMarker( marker [, duration ] ) → {Promise}

Rotate the view to face the marker

Parameters
Name Type Attributes Description
marker *
duration string | int <optional>

rotates smoothy, see PhotoSphereViewer#animate

Returns

A promise that will be resolved when the animation finishes


<protected> hide()

Hides the component


hideMarker( marker )

Hides a marker

Parameters
Name Type Description
marker *

hideMarkersList()

Closes side panel if it contains the list of markers


removeMarker( marker [, render ] )

Removes a marker from the viewer

Parameters
Name Type Attributes Default Description
marker *
render boolean <optional>
true

renders the marker immediately


renderMarkers()

Updates the visibility and the position of all markers


<protected> show()

Displays the component


showMarker( marker )

Shows a marker

Parameters
Name Type Description
marker *

showMarkersList()

Opens side panel with list of markers

Fires

Used to alter the list of markers displayed on the side-panel


toggleMarker( marker )

Toggles a marker

Parameters
Name Type Description
marker *

toggleMarkersList()

Toggles the visibility of markers list


updateMarker( properties [, render ] ) → {PSVMarker}

Updates the existing marker with the same id

Description

Every property can be changed but you can't change its type (Eg: image to html).

Parameters
Name Type Attributes Default Description
properties Object | PSVMarker
render boolean <optional>
true

renders the marker immediately

Returns

Events


leave-marker

Triggered when the user puts the cursor away from a marker

Parameters
Name Type Description
marker PSVMarker

over-marker

Triggered when the user puts the cursor hover a marker

Parameters
Name Type Description
marker PSVMarker

select-marker

Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler with module:components.PSVHUD.getCurrentMarker

Parameters
Name Type Description
marker PSVMarker
dblclick boolean

the simple click is always fired before the double click


unselect-marker

Triggered when a marker was selected and the user clicks elsewhere

Parameters
Name Type Description
marker PSVMarker

filter:render-markers-list

Used to alter the list of markers displayed on the side-panel

Parameters
Name Type Description
markers Array.<PSVMarker>
Returns