class
CoordinatesWidget
Cursor position display. Supports DD (Decimal Degrees), DMS, and MGRS formats.
Constructor
new CoordinatesWidget(options?: CoordinatesWidgetOptions) | Parameter | Type | Description | |
|---|---|---|---|
options | CoordinatesWidgetOptions | optional | Widget configuration |
CoordinatesWidgetOptions
| Field | Type | Description | |
|---|---|---|---|
position | WidgetPosition | optional | Widget position Default: 'bottom-right' |
format | 'DD' | 'DMS' | 'MGRS' | optional | Coordinate display format Default: 'DD' |
Properties
| Name | Type | Access | Description |
|---|---|---|---|
screenToMap | (x: number, y: number) => [number, number] | null | read/write | Set to view.toMap for coordinate conversion |
Methods
setCoordinates()
setCoordinates(lon: number, lat: number): void Manually set displayed coordinates.
Returns
void listenTo()
listenTo(container: HTMLElement): void Auto-update on mouse move over container.
Returns
void mount()
mount(container: HTMLElement): void Mount widget.
Returns
void