Constructors

  • Creates a new InfiniteViewer instance. Provide the viewer container element and optionaly provide options for the viewer.

    The viewer container needs to be able to receive key events for disabling panning by keyboard. (e.g. you can achieve this by setting the "tabindex" property)

    Parameters

    Returns CbnInfiniteViewer

Properties

_options: undefined | Partial<CbnInfiniteViewerOptions>
_viewerContainer: HTMLElement
onAfterPan: ((viewer) => void)

Define a custom action which is executed after the pan

Type declaration

    • (viewer): void
    • Parameters

      • viewer: default

      Returns void

onAfterZoom: ((viewer) => void)

Define a custom action which is executed after the zoom

Type declaration

    • (viewer): void
    • Parameters

      • viewer: default

      Returns void

viewerInstance: default

Methods

  • Handle panning of the viewer with standard CBN settings. Let the user pan the viewer using either right mouse button or middle mouse button. Exceute the onAfterPan on pan end.

    Returns void

  • Handle zooming of the viewer with standard CBN settings. Zoom to the center of the current mouse cursor position. Execute the onAfterZoom after adjusting the zoom lvl.

    Returns void

  • Get the max-bounding-box of the viewport content.

    Returns {
        maxHeight: number;
        maxWidth: number;
    }

    • maxHeight: number
    • maxWidth: number
  • Automatically center the viewport based on the viewport content. Behavior can be customized using the margin value (space arround the content) and the animationDuration (how long the centerViewport will take)

    Parameters

    • marginValue: number = 1

      optional (default: 1)

    • animationDuration: number = 0

      optional (default: 0)

    Returns Promise<void>