Options
All
  • Public
  • Public/Protected
  • All
Menu

api.viewer

The viewer API is for interacting with the viewer UI components and layout.

Hierarchy

  • ViewerAPI

Index

Properties

Methods

Object literals

Properties

Readonly pluginEvents

pluginEvents: any

Proxy interface for all plugin events. pluginEvents.LEAFLET_MAP.LOADED.addEventListener(e => console.log(e))

Methods

activateTool

  • activateTool(tool: ToolType): void
  • Parameters

    • tool: ToolType

    Returns void

allowAllTools

  • allowAllTools(): void
  • Returns void

allowTool

  • allowTool(toolName: string): void
  • Parameters

    • toolName: string

    Returns void

allowTools

  • allowTools(toolNames: string[]): void
  • Parameters

    • toolNames: string[]

    Returns void

areContextMenusAllowed

  • areContextMenusAllowed(): boolean
  • Returns boolean

areKeyboardCommandsAllowed

  • areKeyboardCommandsAllowed(): boolean
  • Returns boolean

deactivateCurrentTool

  • deactivateCurrentTool(): void
  • Returns void

disableCameraTranslation

  • disableCameraTranslation(): void
  • Returns void

disableCtrlClickFocus

  • disableCtrlClickFocus(): void
  • Returns void

disableDoubleClickZoom

  • disableDoubleClickZoom(): void
  • Returns void

disableDragging

  • disableDragging(): void
  • Returns void

disableShiftClickZoom

  • disableShiftClickZoom(): void
  • Returns void

disallowAllTools

  • disallowAllTools(): void
  • Returns void

disallowTool

  • disallowTool(toolName: string): void
  • Parameters

    • toolName: string

    Returns void

disallowTools

  • disallowTools(toolNames: string[]): void
  • Parameters

    • toolNames: string[]

    Returns void

enableCameraTranslation

  • enableCameraTranslation(): void
  • Returns void

enableCtrlClickFocus

  • enableCtrlClickFocus(): void
  • Returns void

enableDoubleClickZoom

  • enableDoubleClickZoom(): void
  • Returns void

enableDragging

  • enableDragging(): void
  • Returns void

enableMouseCoordinates

  • enableMouseCoordinates(enable: boolean): void
  • Set whether display of mouse coordinates is allowed in the viewer

    Parameters

    • enable: boolean

    Returns void

enableShiftClickZoom

  • enableShiftClickZoom(): void
  • Returns void

enableTools

  • enableTools(enable: boolean): void
  • Specifies whether the standard set of tools (in the tool palette) are enabled.

    Parameters

    • enable: boolean

    Returns void

focus

  • focus(): void
  • set the keyboard focus to be on the viewer element

    Returns void

getAllowedTools

  • getAllowedTools(): string[]
  • Returns string[]

getDisabledTools

  • getDisabledTools(): string[]
  • Returns string[]

getMapState

  • get the current layout state of the overview map window

    Returns MapState

getUIOptions

  • Returns IUIOptions

hideCursorLocation

  • hideCursorLocation(): void
  • Returns void

hideMessages

  • hideMessages(hide?: boolean): void
  • Parameters

    • Default value hide: boolean = true

    Returns void

hideScannerPositions

  • hideScannerPositions(saveToLocalStorage?: boolean): void
  • Parameters

    • Default value saveToLocalStorage: boolean = true

    Returns void

isBookmarksPanelShowing

  • isBookmarksPanelShowing(): boolean
  • Returns boolean

isCloseButtonShowing

  • isCloseButtonShowing(): any
  • Returns any

isFullscreen

  • isFullscreen(): boolean
  • Is the viewer currently in fullscreen display mode

    Returns boolean

isFullscreenAllowed

  • isFullscreenAllowed(): boolean
  • Is the viewer allowed to enter fullscreen display mode

    Returns boolean

isFullscreenButtonShowing

  • isFullscreenButtonShowing(): any
  • Returns any

isHidingMessages

  • isHidingMessages(): any
  • Returns any

isHomeButtonShowing

  • isHomeButtonShowing(): boolean
  • Returns boolean

isLeftPanelShowing

  • isLeftPanelShowing(): boolean
  • Returns boolean

isMouseCoordinatesEnabled

  • isMouseCoordinatesEnabled(): boolean
  • Whether display of mouse coordinates is allowed in the viewer

    Returns boolean

isMouseCoordinatesShowing

  • isMouseCoordinatesShowing(): boolean
  • Whether the coordinates of the cursor are currently being displayed.

    Returns boolean

isOptionsButtonShowing

  • isOptionsButtonShowing(): any
  • Returns any

isSearchButtonShowing

  • isSearchButtonShowing(): any
  • Returns any

isShowingScannerPositions

  • isShowingScannerPositions(): any
  • Returns any

isToolAllowed

  • isToolAllowed(toolName: string): boolean
  • Parameters

    • toolName: string

    Returns boolean

isToolsEnabled

  • isToolsEnabled(): boolean
  • Returns boolean

isVisibilityButtonShowing

  • isVisibilityButtonShowing(): any
  • Returns any

minimiseLeftPanel

  • minimiseLeftPanel(minimised: boolean): void
  • Parameters

    • minimised: boolean

    Returns void

notifyClientRefreshRequired

  • notifyClientRefreshRequired(): void
  • In some rare circumstances it may be necessary to force the viewer to refresh/update the view after making a change. Almost all changes made through the API will call this internally if required.

    Returns void

pauseRendering

  • pauseRendering(): void
  • Returns void

resumeRendering

  • resumeRendering(): void
  • Returns void

setAllowedTools

  • setAllowedTools(toolNames: string[]): void
  • Parameters

    • toolNames: string[]

    Returns void

setBackgroundColour

  • setBackgroundColour(hexColourString: string): void
  • Set the background colour of the main viewer window.

    Parameters

    • hexColourString: string

      A standard CSS hex colour string (e.g. #ff5578)

    Returns void

setCursor

  • setCursor(name: any): void
  • set the cursor style for the viewer. Use css cursor style names

    Parameters

    • name: any

    Returns void

setFullscreen

  • setFullscreen(fullScreen: boolean): void
  • Request the viewer to switch to fullscreen display mode. Will be ignored if fullscreen is not allowed.

    Parameters

    • fullScreen: boolean

    Returns void

setMapState

  • Set the layout state of the overview map window

    Parameters

    • state: MapState

      valid values are: "full", "half", "normal", or "minimized"

    Returns void

setUIOptions

  • setUIOptions(options: any): void
  • Parameters

    • options: any

    Returns void

showBookmarksPanel

  • showBookmarksPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showClassificationsCard

  • showClassificationsCard(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showClassificationsPanel

  • showClassificationsPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showCloseButton

  • showCloseButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showCursorLocation

  • showCursorLocation(): void
  • Returns void

showDrawingLayersPanel

  • showDrawingLayersPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showErrorMessage

  • showErrorMessage(message: string, durationSeconds?: number): void
  • Parameters

    • message: string
    • Default value durationSeconds: number = 1

    Returns void

showFullscreenButton

  • showFullscreenButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showHomeButton

  • showHomeButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showInfoMessage

  • showInfoMessage(message: string, durationSeconds?: number): void
  • // Show an info message that hides after 2 seconds
    api.viewer.showInfoMessage("Hello World", 2)

    Parameters

    • message: string
    • Default value durationSeconds: number = 1

    Returns void

showLayersPanel

  • showLayersPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showLeftPanel

  • showLeftPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showMap

  • showMap(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showMessages

  • showMessages(show?: boolean): void
  • Parameters

    • Default value show: boolean = true

    Returns void

showModalMessage

  • showModalMessage(message: string, type?: string): void
  • Shows a message with a close button that will stay on screen until dismissed by the user

    // Show an info message that hides after 2 seconds
    api.viewer.showModalMessage("Hello World")

    Parameters

    • message: string
    • Default value type: string = "success"

    Returns void

showMouseCoordinates

  • showMouseCoordinates(show: boolean): void
  • Show the coordinates of the cursor. Will be ignored if EnableMouseCoordinates is false

    Parameters

    • show: boolean

    Returns void

showOptionsButton

  • showOptionsButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showPointsOfInterestPanel

  • showPointsOfInterestPanel(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showScannerPositions

  • showScannerPositions(saveToLocalStorage?: boolean): void
  • Parameters

    • Default value saveToLocalStorage: boolean = true

    Returns void

showSearchButton

  • showSearchButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showSuccessMessage

  • showSuccessMessage(message: string, durationSeconds?: number): void
  • Parameters

    • message: string
    • Default value durationSeconds: number = 1

    Returns void

showVisibilityButton

  • showVisibilityButton(show: boolean): void
  • Parameters

    • show: boolean

    Returns void

showWarningMessage

  • showWarningMessage(message: string, durationSeconds?: number): void
  • Parameters

    • message: string
    • Default value durationSeconds: number = 1

    Returns void

toggleFullscreen

  • toggleFullscreen(): void
  • Returns void

toggleShowScannerPositions

  • toggleShowScannerPositions(saveToLocalStorage?: boolean): void
  • Parameters

    • Default value saveToLocalStorage: boolean = true

    Returns void

Object literals

Readonly events

events: object

canvasHit

canvasHit: EventEmitter = new EventEmitter()

closeViewerRequested

closeViewerRequested: EventEmitter = new EventEmitter()

fullscreenChanged

fullscreenChanged: EventEmitter = new EventEmitter()

listener receives isFullscreen - a boolean value indicating if the viewer is in the fullscreen state