Last updated

API / geotoolkit / scene / HTMLOverlay / HTMLOverlay

Class: HTMLOverlay

scene.HTMLOverlay.HTMLOverlay

HTMLOverlay is a wrapper for HTMLElement to add to HTMLOverlayLayer

Example

import {HTMLOverlayLayer} from '@int/geotoolkit/scene/HTMLOverlayLayer';
import {HTMLOverlay} from '@int/geotoolkit/scene/HTMLOverlay';
import {Rect} from '@int/geotoolkit/util/Rect';

const htmlOverlayLayer = new HTMLOverlayLayer();
const htmlOverlay = new HTMLOverlay({
'element': document.getElementById('htmlOverlay-element'),
'ax': 0, // x coordinate in model space
'ay': 0, // y coordinate in model space
});
htmlOverlayLayer.addHTMLOverlay(htmlOverlay);

Implements

Table of contents

Constructors
Methods

Contents

Constructors

new HTMLOverlay(options)

new HTMLOverlay(options?)

Parameters

Name Type
Optional optionsOptions
Methods

dispose

dispose(): void

Dispose HTMLOverlay along with HTMLElement of it

Returns

void

Implementation of

IDisposable.dispose


getAnchor

getAnchor(): Point

Gets the anchor

Returns

Point


getAnchorX

getAnchorX(): number

Return anchored x position

Returns

number


getAnchorY

getAnchorY(): number

Return anchored y position

Returns

number


getBounds

getBounds(): Rect

Get bounds in model space

Returns

Rect

Bounds in model space


getClassName

getClassName(): string

Returns

string


getElement

getElement(): HTMLElement

Get HTMLElement

Returns

HTMLElement

HTMLElement


getHeight

getHeight(): number

Return height of the shape

Returns

number


getId

getId(): string

Get id

Returns

string

HTMLOverlay id


getOffset

getOffset(): Point

Get anchor offset in device space

Returns

Point

offset Offset


getOptions

getOptions(): Options

Get options

Returns

Options

Options


getSize

getSize(): Dimension

Returns the size as a dimension object.

Returns

Dimension

size


getWidth

getWidth(): number

Return width of the shape

Returns

number


invalidate

invalidate(): HTMLOverlay

Invalidate HTMLOverlay, should be call when HTMLOverlay changes

Returns

HTMLOverlay

this


isDisposed

isDisposed(): boolean

Whether HTMLOverlay is already disposed

Returns

boolean

True if HTMLOverlay is disposed, false otherwise


setAnchor

setAnchor(point): HTMLOverlay

Sets anchor point to given position

Parameters

Name Type Description
pointPointpoint

Returns

HTMLOverlay

this

setAnchor(x, y): HTMLOverlay

Sets anchor point to given position

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

HTMLOverlay

this


setAnchorX

setAnchorX(ax): HTMLOverlay

Sets x anchor position

Parameters

Name Type Description
axnumberanchor x position

Returns

HTMLOverlay

this


setAnchorY

setAnchorY(ay): HTMLOverlay

Sets y anchor position

Parameters

Name Type Description
aynumberanchor y position

Returns

HTMLOverlay

this


setBounds

setBounds(bounds): HTMLOverlay

Set htmlOverlay bounds in model space, bounds size only works when sizeisindevicespace = false

Parameters

Name Type Description
boundsRectnew bounds in model space

Returns

HTMLOverlay

this


setElement

setElement(element): HTMLOverlay

Set HTMLElement

Parameters

Name Type Description
elementHTMLElementnew HTMLElement

Returns

HTMLOverlay

this


setHeight

setHeight(height): HTMLOverlay

Sets height of the shape

Parameters

Name Type Description
heightnumberheight of the shape

Returns

HTMLOverlay

this


setId

setId(id): HTMLOverlay

Set id

Parameters

Name Type Description
idstringHTMLOverlay id

Returns

HTMLOverlay

this


setOffset

setOffset(x, y?): HTMLOverlay

Set anchor offset in device space

Parameters

Name Type Description
xnumber | Point | OptionsX coordinate
Optional ynumberY coordinate

Returns

HTMLOverlay

this


setOptions

setOptions(options?): HTMLOverlay

Set options

Parameters

Name Type Description
Optional optionsOptionsHTMLOverlay options

Returns

HTMLOverlay

this


setSize

setSize(width, height?): HTMLOverlay

Sets size of the shape, will accept a width and height number or a Dimension object.

Parameters

Name Type Description
widthnumber | Dimensionwidth of the shape
Optional heightnumberheight of the shape

Returns

HTMLOverlay

this


setWidth

setWidth(width): HTMLOverlay

Sets width of the shape

Parameters

Name Type Description
widthnumberwidth of the shape

Returns

HTMLOverlay

this


getClassName

Static getClassName(): string

Returns

string