Constructs a DrawTool
Giro3D instance
Options
Mode of the tool (null if inactive)
State of the tool
Adds a new point at the end of the geometry. If max point is reached, ends the drawing.
Fires DrawToolEventMap.add event.
Fires DrawToolEventMap.drawing event.
Fires DrawToolEventMap.end event if maxPoints
reached.
Position of the new point
Deletes a point.
Fires DrawToolEventMap.delete event. Fires DrawToolEventMap.drawing event.
Point index to delete
Edits a GeoJSON geometry.
Fires DrawToolEventMap.start event at start.
Edits a GeoJSON geometry and returns a promise.
Fires DrawToolEventMap.start event at start.
Promise resolving to the GeoJSON geometry drawn
Ends the current drawing (active or paused).
Fires DrawToolEventMap.end event.
GeoJSON geometry drawn
Inserts a new point at an index. Note: it does not end the drawing if max point is reached.
Fires DrawToolEventMap.add event. Fires DrawToolEventMap.drawing event.
Point index
Position for the new point
Aborts current drawing (active or paused).
Fires DrawToolEventMap.abort event.
Utility function to set options.
See constructor
Starts a new drawing.
Fires DrawToolEventMap.start event at start.
Geometry type to draw
Starts a new drawing and returns a promise.
Fires DrawToolEventMap.start event at start.
Geometry type to draw
Promise resolving to the GeoJSON geometry drawn
Gets the current coordinates of the shape being drawn. In case of polygons, ensures the shape is closed.
Returns null
if the state is DrawToolState.READY or
if the shape is empty.
Array of 3D coordinates
Gets the current GeoJSON geometry corresponding to the shape being drawn. In case of polygons, ensures the shape is closed.
Returns null
if the state is DrawToolState.READY or
if the shape is empty.
GeoJSON geometry object
Updates position of a point.
Fires DrawToolEventMap.edit event. Fires DrawToolEventMap.drawing event.
Point index to update
New position of the point
Enables the user to draw on the map.