Options
All
  • Public
  • Public/Protected
  • All
Menu

api.bookmarks

Bookmarks are the way to save the state of the viewer session, including both the scene properties and the user interface layout.. Bookmarks are associated with a point cloud and are automatically loaded when a point cloud is loaded into the viewer.

The bookmarks namespace is where you interact with bookmarks in the viewer. Most methods and events will require, or return, an ID for each bookmark. The ID is auto-generated when the bookmark is saved to the Pointerra service. It is a unique identifier for a bookmark, and the value can be persisted across sessions.

Hierarchy

  • BookmarkAPI

Index

Methods

add

  • add(name: string, description?: string): Promise<string>
  • Example

    let newBookmarkId = null
    api.bookmarks.add('new bookmark').then(id => newBookmarkId = id)
    
    // or, using async/await
    let newBookmarkId = await api.bookmarks.add('new bookmark')

    Parameters

    • name: string
    • Optional description: string

    Returns Promise<string>

    a promise with the new bookmark ID.

delete

  • delete(id: any): Promise<void>
  • Deletes the bookmark specified by the ID

    Parameters

    • id: any

    Returns Promise<void>

getAll

  • getAll(): string[]
  • Get the IDs of all bookmarks loaded into the viewer

    Returns string[]

getCount

  • getCount(): number
  • Get the current number of bookmarks loaded into the viewer

    Returns number

getDescription

  • getDescription(id: any): string | undefined
  • Get the description of the bookmark with this ID.

    Parameters

    • id: any

    Returns string | undefined

    The description of the specified bookmark, or undefined if id does not match any loaded bookmarks.

getName

  • getName(id: any): string | undefined
  • Get the name of the bookmark with this ID.

    Parameters

    • id: any

    Returns string | undefined

    Name of the bookmark, or undefined if a bookmark with this id is not found.

open

  • open(id: any): void
  • Applies the properties stored in the bookmark to the current viewer session.

    Parameters

    • id: any

    Returns void

reload

  • reload(): Promise<void>
  • Use this method if you update bookmarks external to the viewer (e.g. use the Pointerra REST API to add new Bookmarks to the point cloud). This will refresh the bookmarks from the database into the viewer.

    Returns Promise<void>

setDescription

  • setDescription(id: any, desc: any): Promise<void>
  • Sets the description for the specified bookmark. Has no effect if the ID does not match any loaded bookmarks.

    Parameters

    • id: any
    • desc: any

    Returns Promise<void>

setName

  • setName(id: any, name: any): Promise<void>
  • Sets the display name for the specified bookmark. Has no effect if the ID does not match any loaded bookmarks.

    Parameters

    • id: any
    • name: any

    Returns Promise<void>

Object literals

events

events: object

loaded

loaded: EventEmitter = new EventEmitter()