Skip to main content

Annotation

class Annotation

Annotation(Hotspot) base class

constructor​

new Annotation(view3D, options)
PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
view3DView3DInstance of the view3D
optionsAnnotationOptions✔️{}Options

Properties​

position​

readonly

3D position of the annotation

Type: THREE.Vector3

element​

readonly

Element of the annotation

Type: HTMLElement

renderable​

readonly

Whether this annotation is renderable in the screen

Type: boolean

focusPose​

readonly

An array of values in order of [yaw, pitch, zoom]

Type: Array<number>

focusDuration​

Duration of the focus animation

Type: number

baseFov​

Base fov value that annotation is referencing

Type: number

baseDistance​

Base dsitance value that annotation is referencing

Type: number | null

aspect​

Base aspect value that annotation is referencing

Type: number

hidden​

readonly

Whether the annotation is hidden and not rendered

Type: boolean

Methods​

focus​

Focus camera to this annotation
This will add a class selected to this annotation element.

unfocus​

Unfocus camera.
This will remove a class selected to this annotation element.
To reset camera to the original position, use Camera#reset

toJSON​

Serialize anntation data to JSON format.

destroy​

Destroy annotation and release all resources.

resize​

Resize annotation to the current size

render​

Render annotation element

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
paramsobject

show​

Show annotation.
A class "hidden" will be removed from the annotation element.

hide​

Hide annotation and prevent it from being rendered.
A class "hidden" will be added to the annotation element.

setOpacity​

Set opacity of the annotation
Opacity is automatically controlled with annotationBreakpoints

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
opacitynumberOpacity to apply, number between 0 and 1

enableEvents​

Add browser event handlers

disableEvents​

Remove browser event handlers