Skip to main content

flywave-draw-controls.mapdrawcontrols

Home > @flywave/flywave-draw-controls > MapDrawControls

MapDrawControls class

Signature:

export declare class MapDrawControls extends EventDispatcher<MapDrawControlsEventMap> 

Extends: EventDispatcher<MapDrawControlsEventMap>

Constructors

Constructor

Modifiers

Description

(constructor)(mapView, mapControls)

Constructs a new instance of the MapDrawControls class

Properties

Property

Modifiers

Type

Description

mapControls

protected

MapControls

mapView

protected

MapView

Methods

Method

Modifiers

Description

addObjects(objects)

Add objects in batch

clearAll()

Clear all objects

createDrawLine(mapView, vertices, id)

protected

Create draw line object

createDrawPolygon(mapView, vertices, id)

protected

Create draw polygon object

createPointObject(mapView, position, isVertex, id)

protected

Create point object

dispose()

Release resources

exportToGeoJSON()

Export as GeoJSON format

getCanvasPosition(event, canvas)

Get canvas position

getHeightAdjustManager()

Get height adjustment manager

getIsDrawing()

protected

Get drawing state (for MeasureToolControls use)

getMode()

Get current drawing mode

getObject(id)

Get object by ID

getObjects()

Get all objects

getPointHeight(pointId)

Get point height

getTempObject()

protected

Get temporary object (for MeasureToolControls use)

getTempVertices()

protected

Get temporary vertices (for MeasureToolControls use)

getTilesRenderDataSources()

protected

Get tile render data sources

removeObject(id)

Remove object

setMode(mode)

Set drawing mode

setPointHeight(pointId, height)

Set point height

triggerLabelUpdate()

protected

Trigger label update (for subclass override)

undo()

Undo operation

updateDrawingPreview(event)

protected

Update drawing preview

updateMeasureLabels()

protected

Update measurement label display (for MeasureToolControls use)

visible(visible)

Set the visibility of the drawing controls