Doc > API > TypedViewer

Doc > API > TypedViewer

Base class to create a viewer. It is used for the Threejs viewer as well as the Mapbox Viewer

Methods

.mount(element: HTMLElement)

mounts the viewer onto an element

.unmount()

unmounts the viewer

.canvas()

return the canvas and create one if none yet

.camera()

return the camera the viewer was created with

.dispose()

disposes the viewer

.setAutoRender(state = true)

sets auto render state. If falls, the viewer will not render.

.registerOnBeforeTick(callbackName: string, callback: ViewerTickCallback, options: ViewerCallbackOptions =

registers a BeforeTick callback. BeforeTick callbacks are run before updating the frame (and therefore before any time dependent node has changed)

.unRegisterOnBeforeTick(callbackName: string)

unregisters BeforeTick callback

.registeredBeforeTickCallbacks()

Returns the list registered BeforeTick callback names

.registerOnAfterTick(callbackName: string, callback: ViewerTickCallback, options: ViewerCallbackOptions =

registers AfterTick callback. AfterTick callbacks are run after updating the frame (and therefore after any time dependent node has changed)

.unRegisterOnAfterTick(callbackName: string)

unregisters AfterTick callback

.registeredAfterTickCallbacks()

Returns the list registered AfterTick callback names

.registerOnBeforeRender(callbackName: string, callback: ViewerRenderCallback, options: ViewerCallbackOptions =

registers a BeforeRender callback. BeforeRender callbacks are run before the frame is rendered

.unRegisterOnBeforeRender(callbackName: string)

unregisters BeforeRender callback

.registeredBeforeRenderCallbacks()

Returns the list registered BeforeRender callback names

.registerOnAfterRender( callbackName: string, callback: ViewerRenderCallback, options: ViewerCallbackOptions =

registers a AfterRender callback. AfterRender callbacks are run after the frame is rendered

.unRegisterOnAfterRender(callbackName: string)

unregisters AfterRender callback

.registeredAfterRenderCallbacks()

Returns the list AfterRender BeforeRender callback names

source