Constructs a DrawTool
Giro3D instance
Options
Private
_canPrivate
_canPrivate
_coordinatesPrivate
_draggedPrivate
_drawPrivate
_drawPrivate
_edgesPrivate
_enablePrivate
_enablePrivate
_enablePrivate
_endPrivate
_eventPrivate
_geometryPrivate
_getPrivate
_instancePrivate
_internalPrivate
_maxPrivate
_minPrivate
_modePrivate
_nextPrivate
_nextPrivate
_oldPrivate
_point2DFactoryPrivate
_pointsPrivate
_realPrivate
_realPrivate
_rejectOptional
reason: anyPrivate
_resolvePrivate
_splicingPrivate
_splicingPrivate
_splicingPrivate
_splicingPrivate
_stateMode of the tool (null if inactive)
State of the tool
Private
_cleanPrivate
_cleanPrivate
_createPrivate
_defaultPrivate
_defaultPrivate
_endTriggers end after the event loop has been processed. When deferring ending, any click events on the canvas will be handled before ending.
Let's take an example where the app:
end
event and creates a GeometryObject based on the geometry,click
events on the canvas to check for GeometryObject
and edit them.Without deferring, the following would happen:
this.end()
, triggering end
eventend
event is processed by app, creating the shapeclick
event on canvas is processed by the app (because we're still processing
that event!)With deferring:
this.end()
is queued in event loopclick
event on canvas is processed by the appthis.end()
is called, triggering end
eventend
event is processed by app, creating the shapePrivate
_endPrivate
_hidePrivate
_hidePrivate
_initInitializes common stuff when starting drawing for both editing & creating.
Mode to start
Optional
geometryType: DrawingGeometryTypeGeometry type to create
(if null
, geometry
must be provided)
Optional
geometry: Geometry | DrawingGeometry to edit
Private
_onPrivate
_onPrivate
_onPrivate
_popPrivate
_pushPrivate
_removePrivate
_restorePrivate
_setPrivate
_setPrivate
_splicePrivate
_startPrivate
_tryPrivate
_tryPrivate
_tryPrivate
_tryPrivate
_tryPrivate
_updatePrivate
_updatePrivate
_updatePrivate
_updateUpdates rendering of 3D points. This is useful if we change the number of points, so we keep a simple logic for managing ordering & event handlers.
Instead of having to deal with reordering all the other points & deal with event handlers, let's clean & recreate everything. As long as we don't have 10000 points in our geometry, we should be OK.
Private
_updateAdds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Fire an event type.
The event that gets fired.
Edits a GeoJSON geometry and returns a promise.
Fires start event at start.
Promise resolving to the GeoJSON geometry drawn
Ends the current drawing (active or paused).
Fires end event.
GeoJSON geometry drawn
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
Aborts current drawing (active or paused).
Fires abort event.
Utility function to set options.
See constructor
Starts a new drawing.
Fires start event at start.
Geometry type to draw
Starts a new drawing and returns a promise.
Fires 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 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 READY or
if the shape is empty.
GeoJSON geometry object
Generated using TypeDoc
Enables the user to draw on the map.