API / geotoolkit / scene / HTMLOverlay / 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);Constructors
Methods
Methods
▸ dispose(): void
Dispose HTMLOverlay along with HTMLElement of it
void
▸ getAnchor(): Point
Gets the anchor
▸ getAnchorX(): number
Return anchored x position
number
▸ getAnchorY(): number
Return anchored y position
number
▸ getBounds(): Rect
Get bounds in model space
Bounds in model space
▸ getClassName(): string
string
▸ getElement(): HTMLElement
Get HTMLElement
HTMLElement
HTMLElement
▸ getHeight(): number
Return height of the shape
number
▸ getId(): string
Get id
string
HTMLOverlay id
▸ getOffset(): Point
Get anchor offset in device space
offset Offset
▸ getOptions(): Options
Get options
Options
▸ getSize(): Dimension
Returns the size as a dimension object.
size
▸ getWidth(): number
Return width of the shape
number
▸ invalidate(): HTMLOverlay
Invalidate HTMLOverlay, should be call when HTMLOverlay changes
this
▸ isDisposed(): boolean
Whether HTMLOverlay is already disposed
boolean
True if HTMLOverlay is disposed, false otherwise
▸ setAnchor(point): HTMLOverlay
Sets anchor point to given position
| Name | Type | Description |
|---|---|---|
point | Point | point |
this
▸ setAnchor(x, y): HTMLOverlay
Sets anchor point to given position
| Name | Type | Description |
|---|---|---|
x | number | x coordinate |
y | number | y coordinate |
this
▸ setAnchorX(ax): HTMLOverlay
Sets x anchor position
| Name | Type | Description |
|---|---|---|
ax | number | anchor x position |
this
▸ setAnchorY(ay): HTMLOverlay
Sets y anchor position
| Name | Type | Description |
|---|---|---|
ay | number | anchor y position |
this
▸ setBounds(bounds): HTMLOverlay
Set htmlOverlay bounds in model space, bounds size only works when sizeisindevicespace = false
| Name | Type | Description |
|---|---|---|
bounds | Rect | new bounds in model space |
this
▸ setElement(element): HTMLOverlay
Set HTMLElement
| Name | Type | Description |
|---|---|---|
element | HTMLElement | new HTMLElement |
this
▸ setHeight(height): HTMLOverlay
Sets height of the shape
| Name | Type | Description |
|---|---|---|
height | number | height of the shape |
this
▸ setId(id): HTMLOverlay
Set id
| Name | Type | Description |
|---|---|---|
id | string | HTMLOverlay id |
this
▸ setOffset(x, y?): HTMLOverlay
Set anchor offset in device space
this
▸ setOptions(options?): HTMLOverlay
Set options
| Name | Type | Description |
|---|---|---|
Optional options | Options | HTMLOverlay options |
this
▸ setSize(width, height?): HTMLOverlay
Sets size of the shape, will accept a width and height number or a Dimension object.
| Name | Type | Description |
|---|---|---|
width | number | Dimension | width of the shape |
Optional height | number | height of the shape |
this
▸ setWidth(width): HTMLOverlay
Sets width of the shape
| Name | Type | Description |
|---|---|---|
width | number | width of the shape |
this
▸ Static getClassName(): string
string