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
-
Available events
-
-
-
-
Unique identifier of the plugin
-
-
markers Object.<string, PSV.plugins.MarkersPlugin.Marker>
All registered markers
-
-
psv PSV.Viewer readonly inherited overrides
Reference to main controller
-
-
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 -
-
Removes all markers
-
Name Type Default Description render
boolean true optional renders the markers immediately
-
destroy () package overrides
-
-
getCurrentMarker ()PSV.plugins.MarkersPlugin.Marker
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 -
-
getMarkers ()Array.<PSV.plugins.MarkersPlugin.Marker>
Returns all the markers
-
Returns:
Type Description Array.<PSV.plugins.MarkersPlugin.Marker> -
Returns the total number of markers
-
Returns:
Type Description number -
gotoMarker (markerId, speed)PSV.utils.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.utils.Animation A promise that will be resolved when the animation finishes -
Hides all markers
-
Fires:
-
Hides all tooltips
-
-
Hides a marker
-
Name Type Description markerId
string -
Closes side panel if it contains the list of markers
-
-
Hides the tooltip
-
Name Type Description markerId
string -
init () package overrides
-
-
Removes a marker from the viewer
-
Name Type Default Description markerId
string render
boolean true optional renders the marker immediately
-
Removes multiple markers
-
Name Type Default Description markerIds
Array.<string> render
boolean true optional renders the markers immediately
-
Updates the visibility and the position of all markers
-
-
Replaces all markers
-
Name Type Default Description markers
Array.<PSV.plugins.MarkersPlugin.Properties> render
boolean true optional renders the marker immediately
-
Shows all markers
-
Fires:
-
Displays all tooltips
-
-
Shows a marker
-
Name Type Description markerId
string -
Opens the panel with the content of the marker
-
Name Type Description markerId
string -
Opens side panel with the list of markers
-
Fires:
-
Forces the display of the tooltip
-
Name Type Description markerId
string -
Toggles the visibility of all tooltips
-
-
Toggles a marker
-
Name Type Default Description markerId
string visible
boolean null optional -
Toggles the visibility of the list of markers
-
-
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
tohtml
).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
-
Properties:
Name Type Argument Default Description clickEventOnMarker
boolean <optional>
false If a
click
event is triggered on the viewer additionally to theselect-marker
event.gotoMarkerSpeed
string | number <optional>
8rpm Default animation speed for
gotoMarker
methodmarkers
Array.<PSV.plugins.MarkersPlugin.Properties> <optional>
-
Marker properties, see https://photo-sphere-viewer.js.org/plugins/plugin-markers.html#markers-options
-
-
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
-
Triggered when the animation to a marker is done
-
Name Type Description marker
PSV.plugins.MarkersPlugin.Marker -
Triggered when the markers are hidden
-
-
Triggered when the user puts the cursor away from a marker
-
Name Type Description marker
PSV.plugins.MarkersPlugin.Marker -
Triggered when the visibility of a marker changes
-
Name Type Description marker
PSV.plugins.MarkersPlugin.Marker visible
boolean -
Triggered when the user puts the cursor hover a marker
-
Name Type Description marker
PSV.plugins.MarkersPlugin.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 -
Triggered when a marker is selected from the side panel
-
Name Type Description marker
PSV.plugins.MarkersPlugin.Marker -
Triggered when the list of markers changes
-
Name Type Description markers
Array.<PSV.plugins.MarkersPlugin.Marker> -
Triggered when the markers are shown
-
-
Triggered when a marker was selected and the user clicks elsewhere
-
Name Type Description marker
PSV.plugins.MarkersPlugin.Marker -
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>