NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import Annotation from 'ngl/src/component/annotation.js'
public class | source

Annotation

Annotation HTML element floating on top of a position rendered in 3d

Constructor Summary

Public Constructor
public

constructor(component: Component, position: Vector3, content: String | Element, params: Object)

Member Summary

Public Members
public
public
public
public
public
public
public
public
Private Members
private
private
private
private

Method Summary

Public Methods
public

Safely remove the annotation

public
public

setContent(value: String | Element): undefined

Set HTML content of the annotation

public

Set visibility of the annotation

public
Private Methods
private
private

Public Constructors

public constructor(component: Component, position: Vector3, content: String | Element, params: Object) source

Params:

NameTypeAttributeDescription
component Component

the associated component

position Vector3

position in 3d

content String | Element

HTML content

params Object
  • optional

parameters

params.offsetX Integer

2d offset in x direction

params.offsetY Integer

2d offset in y direction

params.visible Boolean

visibility flag

Public Members

public component source

public element source

public offsetX source

public offsetY source

public position source

public stage source

public viewer source

public visible source

Private Members

private _cameraPosition source

private _canvasPosition source

private _clientRect source

private _viewerPosition source

Public Methods

public dispose(): undefined source

Safely remove the annotation

Return:

undefined

public getVisibility() source

public setContent(value: String | Element): undefined source

Set HTML content of the annotation

Params:

NameTypeAttributeDescription
value String | Element

HTML content

Return:

undefined

public setVisibility(value: Boolean): undefined source

Set visibility of the annotation

Params:

NameTypeAttributeDescription
value Boolean

visibility flag

Return:

undefined

public updateVisibility() source

Private Methods

private _update() source

private _updateViewerPosition() source