Skip to content
Last updated

API / geotoolkit / controls / tooltip / ToolTip / ToolTip

Class: ToolTip

tooltip.ToolTip.ToolTip

Provides HTML based tooltip helper to display content information

Hierarchy

Table of contents

Constructors
  • [new ToolTip(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tooltip.tooltip.tooltip.md#new tooltip(options))
Methods
Css Properties
Name Type Description
alignmentAnchorTypeTooltip alignment according to the point set by offsets
autoflipbooleanTrue to automatically flip tooltip alignment if it doesn't fit the window
cssclassesstringCSS classes' names to be applied for tooltip 'cg-tooltip' by default
delaynumber
hidedelaynumberAuto hide in millisecond, 0 means false and autohide is disabled
offsetxnumberOffset of tooltip from current position by x in pixels
offsetynumberOffset of tooltip from current position by y in pixels
orientationOrientationTooltip orientation
showdelaynumberDelay between displaying tooltip, 0 means false and tooltip shows immediately
sizeRangeClient size range
size-highnumberUpper range boundary
size-lownumberLower range boundary
size-maxnumber
size-minnumber

Contents

Constructors

new ToolTip(options)

• Protected new ToolTip(options?)

Parameters

Name Type Description
Optional optionsOptionstooltip properties

Overrides

EventDispatcher.constructor

Methods

dispose

▸ dispose(): void

Dispose.

Returns

void

Inherited from

EventDispatcher.dispose


getAnchorCssClasses

▸ getAnchorCssClasses(): Partial<Record<AnchorCssKeys, string&gt;&gt;

Return CSS class map for tooltip anchors

Returns

Partial<Record<AnchorCssKeys, string&gt;&gt;

CSS classes


getAnchorType

▸ getAnchorType(): AnchorType

Get element anchor type

Returns

AnchorType

Element anchor type


getAutoFlip

▸ getAutoFlip(): boolean

Return auto-flip state, true if auto-flip is enabled

Returns

boolean


getAutoHide

▸ getAutoHide(): number

Return tooltip auto-hide delay, 0 means false and auto hide is disabled

Returns

number


getClassName

▸ getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getClientSizeRange

▸ getClientSizeRange(): Range

Returns client size range by width

Returns

Range

size range


getCssClasses

▸ getCssClasses(): string

Return CSS classes for tooltip

Returns

string

CSS classes


getDelay

▸ getDelay(): number

Return delay in miliseconds to auto hide tooltip if auto hide is specified

Returns

number


getFade

▸ getFade(): number

Return delay in miliseconds to auto hide tooltip if auto hide is specified

Returns

number


getHTML

▸ getHTML(): string | HTMLElement

Returns tooltip content

Returns

string | HTMLElement

tooltip content


getId

▸ getId(): string

Return tooltip ID

Returns

string

tooltip id


getNode

▸ getNode(): Node

Return tooltip node

Returns

Node

node tooltip associated with


getOffset

▸ getOffset(): Point

Get offset

Returns

Point

Offset


getOrientation

▸ getOrientation(): Orientation

Set element orientation

Returns

Orientation

this


getPlot

▸ getPlot(): Plot

Return tooltip Plot

Returns

Plot

plot tooltip associated with


getProperties

▸ getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties


hasEventListener

▸ hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

EventDispatcher.hasEventListener


hide

▸ hide(fade?): ToolTip

Hide Tooltip

Parameters

Name Type Description
Optional fadenumberfade transition in milliseconds

Returns

ToolTip


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

EventDispatcher.isDisposed


isSilent

▸ isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

EventDispatcher.isSilent


isVisible

▸ isVisible(): boolean

Returs tooltip visible state

Returns

boolean

visible state


notify

▸ notify(type, source, args?): ToolTip

Notify listeners

Parameters

Name Type Description
typestringevent types
sourceanyof the event
Optional argsanyarguments of the event

Returns

ToolTip

this

Inherited from

EventDispatcher.notify


off

▸ off(type?, callback?): ToolTip

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Parameters

Name Type Description
Optional typestringtype of the event
Optional callbackEventListenerfunction to be called

Returns

ToolTip

this

Inherited from

EventDispatcher.off

▸ off<E&gt;(type, callback): ToolTip

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: ToolTip, args: EventMap[E]) => void

Returns

ToolTip

Inherited from

EventDispatcher.off


on

▸ on(type, callback, options?): ToolTip

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target. </p>

Parameters

Name Type Description
typestringtype of event or property
callbackEventListenerto be called
Optional optionsOptionsoptions of subscription

Returns

ToolTip

this

Inherited from

EventDispatcher.on

▸ on<E&gt;(type, callback, options?): ToolTip

Type parameters

NameType
Eextends string

Parameters

Name Type
typeE
callback(eventType: E, sender: ToolTip, args: EventMap[E]) => void
Optional optionsOptions

Returns

ToolTip

Inherited from

EventDispatcher.on


setAnchorCssClasses

▸ setAnchorCssClasses(cssAnchorClasses): ToolTip

Sets CSS class map for tooltip anchors (to render arrows), by default this map contains css-classnames for the following anchors { 'topcenter': 'cg-tooltip-arrow-top', 'bottomcenter': 'cg-tooltip-arrow-bottom', 'leftcenter': 'cg-tooltip-arrow-left', 'rightcenter': 'cg-tooltip-arrow-right' } you can set it to null is to remove default css classes and use rectangular tooltip instead of callout

Parameters

Name Type Description
cssAnchorClassesPartial<Record<AnchorCssKeys, string&gt;&gt;CSS classes

Returns

ToolTip

this


setAnchorType

▸ setAnchorType(alignment): ToolTip

Set element anchor type

Parameters

Name Type
alignmentAnchorType

Returns

ToolTip

this


setAutoFlip

▸ setAutoFlip(autoFlip): ToolTip

Set tooltip auto-flip in case if there is not enough space to display

Parameters

Name Type Description
autoFlipbooleanEnable auto-flip

Returns

ToolTip

this


setAutoHide

▸ setAutoHide(autoHide): ToolTip

Set tooltip auto-hide delay, 0 means false and auto hide is disabled

Parameters

Name Type Description
autoHidenumberEnable auto-hide

Returns

ToolTip

this


setClientSizeRange

▸ setClientSizeRange(sizeRange): ToolTip

Sets client size range by width

Parameters

Name Type Description
sizeRangeRange | OptionsSize range

Returns

ToolTip

this


setCssClasses

▸ setCssClasses(cssClass): ToolTip

Sets CSS classes to be allied for tooltip

Parameters

Name Type
cssClassstring

Returns

ToolTip

this


setDelay

▸ setDelay(delay): ToolTip

Set delay in miliseconds to auto hide tooltip if auto hide is specified

Parameters

Name Type Description
delaynumberdelay in miliseconds

Returns

ToolTip

this


setFade

▸ setFade(fade): ToolTip

Set delay in miliseconds to auto hide tooltip if auto hide is specified

Parameters

Name Type
fadenumber

Returns

ToolTip

this


setHTML

▸ setHTML(html): ToolTip

Sets tooltip content

Parameters

Name Type Description
htmlstring | HTMLElementHTML tooltip content

Returns

ToolTip

this


setNode

▸ setNode(node): ToolTip

Parameters

Name Type
nodeNode

Returns

ToolTip


setOffset

▸ setOffset(offsetX, offsetY): ToolTip

Set offset

Parameters

Name Type Description
offsetXnumberX offset
offsetYnumberY offset

Returns

ToolTip

this


setOrientation

▸ setOrientation(orientation): ToolTip

Get element orientation

Parameters

Name Type
orientationOrientation

Returns

ToolTip

Element orientation


setProperties

▸ setProperties(properties?): ToolTip

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesPropertiesobject containing the properties to set

Returns

ToolTip


setSilent

▸ setSilent(bool): ToolTip

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ToolTip

this

Inherited from

EventDispatcher.setSilent


show

▸ show(position): ToolTip

Show tooltip in specified coordinates

Throws

Error if target is not valid

Parameters

Name Type Description
positionPoint | Optionstooltip position in plot coordinates

Returns

ToolTip


createToolTip

▸ Static createToolTip(target, options?): ToolTip

Create tooltip for specified Plot or Node

Parameters

Name Type Description
targetNode | PlotPlot or Node tooltip associated with
Optional optionsOptionstooltip options

Returns

ToolTip

new tooltip


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

EventDispatcher.getClassName


getDefault

▸ Static getDefault(target): ToolTip

Returns default tooltip associated with Plot containing specified Node

Throws

Error if target is not valid

Parameters

Name Type Description
targetNodeNode tooltip associated with

Returns

ToolTip

tooltip

▸ Static getDefault(target): ToolTip

Returns default tooltip associated with specified Plot

Throws

Error if target is not valid

Parameters

Name Type Description
targetPlotPlot tooltip associated with

Returns

ToolTip

tooltip