Skip to content

Class: RegionDrawer ​

Defined in: autk-map/src/region-drawer.ts:68

A drawing tool over the map: polygons, rectangles and arrows, reported as longitude and latitude.

Constructors ​

Constructor ​

new RegionDrawer(map, host, options?): RegionDrawer

Defined in: autk-map/src/region-drawer.ts:99

Parameters ​

map ​

AutkMap

The map to draw over.

host ​

HTMLElement

The positioned element that holds the map's canvas (e.g. position: relative).

options? ​

RegionDrawerOptions = {}

Drawing options.

Returns ​

RegionDrawer

Properties ​

events ​

readonly events: EventEmitter<RegionDrawerEvents>

Defined in: autk-map/src/region-drawer.ts:70

The shapes the drawer reports.

Accessors ​

tool ​

Get Signature ​

get tool(): DrawTool

Defined in: autk-map/src/region-drawer.ts:132

The active tool.

Returns ​

DrawTool

Methods ​

cancel() ​

cancel(): boolean

Defined in: autk-map/src/region-drawer.ts:145

Drops the shape in progress. Returns whether there was one.

Returns ​

boolean


destroy() ​

destroy(): void

Defined in: autk-map/src/region-drawer.ts:157

Removes the overlay and its listeners. The drawer cannot be used afterwards.

Returns ​

void


setTool() ​

setTool(tool): void

Defined in: autk-map/src/region-drawer.ts:137

Switches tools, dropping any shape in progress. none gives the pointer back to the map.

Parameters ​

tool ​

DrawTool

Returns ​

void

Released under the MIT License.