Class: MarkersPlugin

PSV.plugins~MarkersPlugin

new MarkersPlugin (psv, options)

Displays various markers on the viewer

Name Type Description
psv PSV.Viewer
options PSV.plugins.MarkersPlugin.Options optional

Extends

Classes

Marker

Object representing a marker

Members

container HTMLElement readonly

EVENTS string constant

Available events

id string readonly inherited overrides

Unique identifier of the plugin

ID_PANEL_MARKER string constant

Panel identifier for marker content

ID_PANEL_MARKERS_LIST string constant

Panel identifier for markers list

MARKER_DATA string constant

Property name added to marker elements

markers Object.<string, PSV.plugins.MarkersPlugin.Marker>

All registered markers

MARKERS_LIST_TEMPLATE

Markers list template

Reference to main controller

SVG_NS string constant

Namespace for SVG creation

svgContainer SVGElement readonly

Methods

addMarker (properties, render)PSV.plugins.MarkersPlugin.Marker

Adds a new marker to viewer

Name Type Default Description
properties PSV.plugins.MarkersPlugin.Properties
render boolean true optional

renders the marker immediately

Throws:

when the marker's id is missing or already exists

Type
PSV.PSVError
Returns:
Type Description
PSV.plugins.MarkersPlugin.Marker

clearMarkers (render)

Removes all markers

Name Type Default Description
render boolean true optional

renders the markers immediately

destroy () package overrides

Returns the last marker selected by the user

Returns:
Type Description
PSV.plugins.MarkersPlugin.Marker

getMarker (markerId)PSV.plugins.MarkersPlugin.Marker

Returns the internal marker object for a marker id

Name Type Description
markerId string
Throws:

when the marker cannot be found

Type
PSV.PSVError
Returns:
Type Description
PSV.plugins.MarkersPlugin.Marker

getNbMarkers ()number

Return the total number of markers

Returns:
Type Description
number

gotoMarker (markerId, speed)PSV.Animation

Rotate the view to face the marker

Name Type Description
markerId string
speed string | number optional

rotates smoothy, see PSV.Viewer#animate

Fires:
Returns:
Type Description
PSV.Animation A promise that will be resolved when the animation finishes

hide ()

Fires:

hideAllTooltips ()

Hides all tooltips

hideMarker (markerId)

Hides a marker

Name Type Description
markerId string

hideMarkersList ()

Closes side panel if it contains the list of markers

removeMarker (markerOrId, render)

Removes a marker from the viewer

Name Type Default Description
markerOrId *
render boolean true optional

renders the marker immediately

renderMarkers ()

Updates the visibility and the position of all markers

setMarkers (markers, render)

Replaces all markers

Name Type Default Description
markers Array.<PSV.plugins.MarkersPlugin.Properties>
render boolean true optional

renders the marker immediately

show ()

Fires:

showAllTooltips ()

Displays all tooltips

showMarker (markerId)

Shows a marker

Name Type Description
markerId string

showMarkerPanel (markerId)

Opens the panel with the content of the marker

Name Type Description
markerId string

showMarkersList ()

Opens side panel with list of markers

Fires:

toggleAllTooltips ()

Toggles the visibility of all tooltips

toggleMarker (markerId)

Toggles a marker

Name Type Description
markerId string

toggleMarkersList ()

Toggles the visibility of markers list

updateMarker (properties, render)PSV.plugins.MarkersPlugin.Marker

Updates the existing marker with the same id

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

Name Type Default Description
properties PSV.plugins.MarkersPlugin.Properties
render boolean true optional

renders the marker immediately

Returns:
Type Description
PSV.plugins.MarkersPlugin.Marker

Type Definitions

PSV.plugins.MarkersPlugin.Options Object

Properties:
Name Type Argument Default Description
clickEventOnMarker boolean <optional>
false

If a click event is triggered on the viewer additionally to the select-marker event.

markers Array.<PSV.plugins.MarkersPlugin.Properties> <optional>

PSV.plugins.MarkersPlugin.Properties Object

Marker properties, see http://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options

PSV.plugins.MarkersPlugin.SelectMarkerData Object

Data of the select-marker event

Properties:
Name Type Description
dblclick boolean

if the selection originated from a double click, the simple click is always fired before the double click

rightclick boolean

if the selection originated from a right click

Events

PSV.plugins.MarkersPlugin.event:goto-marker-done

Triggered when the animation to a marker is done

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker

PSV.plugins.MarkersPlugin.event:hide-markers

Triggered when the markers are hidden

PSV.plugins.MarkersPlugin.event:leave-marker

Triggered when the user puts the cursor away from a marker

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker

PSV.plugins.MarkersPlugin.event:over-marker

Triggered when the user puts the cursor hover a marker

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker

PSV.plugins.MarkersPlugin.event:select-marker

Triggered when the user clicks on a marker. The marker can be retrieved from outside the event handler with PSV.plugins.MarkersPlugin.getCurrentMarker

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker
data PSV.plugins.MarkersPlugin.SelectMarkerData

PSV.plugins.MarkersPlugin.event:select-marker-list

Triggered when a marker is selected from the side panel

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker

PSV.plugins.MarkersPlugin.event:show-markers

Triggered when the markers are shown

PSV.plugins.MarkersPlugin.event:unselect-marker

Triggered when a marker was selected and the user clicks elsewhere

Name Type Description
marker PSV.plugins.MarkersPlugin.Marker

PSV.plugins.MarkersPlugin.filter:render-markers-list

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

Name Type Description
markers Array.<PSV.plugins.MarkersPlugin.Marker>
Returns:
Type Description
Array.<PSV.plugins.MarkersPlugin.Marker>