Skip to main content
Version: 4.x

Class: Overlay3DTool<ContentType>

Tool for adding and interacting with 2D overlays positioned at points in

Extends

Type Parameters

ContentType = DefaultOverlay3DContentType

Constructors

new Overlay3DTool()

new Overlay3DTool<ContentType>(viewer, toolParameters?): Overlay3DTool<ContentType>

Parameters

viewer: Cognite3DViewer

toolParameters?: Overlay3DToolParameters

Returns

Overlay3DTool<ContentType>

Overrides

Cognite3DViewerToolBase . constructor

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:97

Methods

clear()

clear(): void

Removes all overlays.

Returns

void

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:193


createOverlayCollection()

createOverlayCollection(overlays?, options?): OverlayCollection<ContentType>

Creates new OverlayCollection.

Parameters

overlays?: OverlayInfo<ContentType>[]

Array of overlays to add.

options?: OverlayCollectionOptions

Returns

OverlayCollection<ContentType>

Overlay group containing it's id.

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:114


dispose()

dispose(): void

Dispose of resources used by this tool

Returns

void

Overrides

Cognite3DViewerToolBase . dispose

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:249


getCollections()

getCollections(): OverlayCollection<ContentType>[]

Gets all added overlay collections.

Returns

OverlayCollection<ContentType>[]

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:152


getTextOverlayVisible()

getTextOverlayVisible(): boolean

Gets whether text overlay is visible.

Returns

boolean

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:186


getVisible()

getVisible(): boolean

Gets whether overlays are visible.

Returns

boolean

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:171


off()

off(event, eventHandler)

off(event, eventHandler): void

Unregisters an event handler for the 'disposed'-event.

Parameters

event: "hover"

eventHandler: OverlayEventHandler<ContentType>

Returns

void

Overrides

Cognite3DViewerToolBase . off

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:226

off(event, eventHandler)

off(event, eventHandler): void

Parameters

event: "click"

eventHandler: OverlayEventHandler<ContentType>

Returns

void

Overrides

Cognite3DViewerToolBase.off

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:227

off(event, eventHandler)

off(event, eventHandler): void

Parameters

event: "disposed"

eventHandler: DisposedDelegate

Returns

void

Overrides

Cognite3DViewerToolBase.off

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:228


on()

on(event, eventHandler)

on(event, eventHandler): void

Subscribes to overlay events.

Parameters

event: "hover"

event to subscribe to.

eventHandler: OverlayEventHandler<ContentType>

Returns

void

Overrides

Cognite3DViewerToolBase.on

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:206

on(event, eventHandler)

on(event, eventHandler): void

Parameters

event: "click"

eventHandler: OverlayEventHandler<ContentType>

Returns

void

Overrides

Cognite3DViewerToolBase.on

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:207

on(event, eventHandler)

on(event, eventHandler): void

Parameters

event: "disposed"

eventHandler: DisposedDelegate

Returns

void

Overrides

Cognite3DViewerToolBase.on

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:208


removeOverlayCollection()

removeOverlayCollection(overlayCollection): void

Removes overlays that were added with addOverlays method.

Parameters

overlayCollection: OverlayCollection<ContentType>

Id of the overlay group to remove.

Returns

void

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:137


setTextOverlayVisible()

setTextOverlayVisible(visible): void

Sets whether text overlay is visible. Default is false.

Parameters

visible: boolean

Returns

void

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:179


setVisible()

setVisible(visible): void

Sets whether overlays are visible.

Parameters

visible: boolean

Returns

void

Defined in

packages/tools/src/Overlay3D/Overlay3DTool.ts:159