Options
All
  • Public
  • Public/Protected
  • All
Menu

Toolbar that supports functionality to create new geometries by drawing them: points (POINT or MULTI_POINT), lines (LINE, POLYLINE, or FREEHAND_POLYLINE), polygons (FREEHAND_POLYGON or POLYGON), or rectangles (EXTENT). To edit geometries of existing graphics, use the Edit Toolbar.

Hierarchy

Implements

  • Draw

Index

Constructors

constructor

Properties

Protected _arrowShapeTemplate

_arrowShapeTemplate: number[][]

Templates for pre-defined shapes that can be drawn with this tool

Protected _downArrowShapeTemplate

_downArrowShapeTemplate: number[][]

Protected _leftArrowShapeTemplate

_leftArrowShapeTemplate: number[][]

_map

_map: Map

The map instance.

Protected _rectangleShapeTemplate

_rectangleShapeTemplate: number[][]

Protected _rightArrowShapeTemplate

_rightArrowShapeTemplate: number[][]

Protected _triangleShapeTemplate

_triangleShapeTemplate: number[][]

Protected _upArrowShapeTemplate

_upArrowShapeTemplate: number[][]

app

The {@link geocortex.essentialsHtmlViewer.ViewerApplication} that this Draw toolbar instance belongs to.

fillSymbol

fillSymbol: SimpleFillSymbol

Symbol to be used when drawing a Polygon or Extent.

id

id: string

inputMethod

inputMethod: string

The mode the component is running - e.g. mouse, keyboard

isKeyboardActive

isKeyboardActive: boolean

lineSymbol

lineSymbol: SimpleLineSymbol

Symbol to be used when drawing a Polyline.

markerSymbol

markerSymbol: SimpleMarkerSymbol

Symbol to be used when drawing a Point or Multipoint.

respectDrawingVertexOrder

respectDrawingVertexOrder: boolean

When set to false, the geometry is modified to be topologically correct.

selectedVertexSymbol

selectedVertexSymbol: MarkerSymbol

Marker symbol used to draw the currently selected vertex while in keyboard mode. Valid for polyline and polygon geometries.

suspended

suspended: boolean

vertexSymbol

vertexSymbol: SimpleMarkerSymbol

Marker symbol used to draw the vertices while in keyboard mode. Valid for polyline and polygon geometries.

Static ARROW

ARROW: string

Draws an arrow.

Static CIRCLE

CIRCLE: string

Draws a circle.

Static DOWN_ARROW

DOWN_ARROW: string

Draws an arrow that points down.

Static ELLIPSE

ELLIPSE: string

Draws an ellipse.

Static EXTENT

EXTENT: string

Draws an extent box.

Static FREEHAND_POLYGON

FREEHAND_POLYGON: string

Draws a freehand polygon.

Static FREEHAND_POLYLINE

FREEHAND_POLYLINE: string

Draws a freehand polyline.

Static LEFT_ARROW

LEFT_ARROW: string

Draws an arrow that points left.

Static LINE

LINE: string

Draws a line.

Static MULTI_POINT

MULTI_POINT: string

Draws a Multipoint.

Static POINT

POINT: string

Draws a point.

Static POLYGON

POLYGON: string

Draws a polygon.

Static POLYLINE

POLYLINE: string

Draws a polyline.

Static RECTANGLE

RECTANGLE: string

Draws a rectangle.

Static RIGHT_ARROW

RIGHT_ARROW: string

Draws an arrow that points right.

Static TRIANGLE

TRIANGLE: string

Draws a triangle.

Static UP_ARROW

UP_ARROW: string

Draws an arrow that points up.

Methods

Protected _addNewVertex

  • _addNewVertex(mapPoint: Point, screenPoint?: ScreenPoint): void
  • Parameters

    • mapPoint: Point
    • Optional screenPoint: ScreenPoint

    Returns void

Protected _addVertex

  • _addVertex(vertex: Point): void
  • Parameters

    • vertex: Point

    Returns void

Protected _clear

  • _clear(): void
  • Returns void

Private _drawComplete

  • _drawComplete(geometry: Geometry): void
  • Fires the draw complete event.

    Parameters

    • geometry: Geometry

    Returns void

Protected _drawPolyGeometry

  • _drawPolyGeometry(start: Point, geometryType: string): Promise<Geometry>
  • Starts digitizing polygons, polylines or multi-points via the keyboard. Returns a promise that is fulfilled once the user completes the drawing.

    Parameters

    • start: Point
    • geometryType: string

    Returns Promise<Geometry>

Protected _drawPolyGeometry_handleKeyDown

  • _drawPolyGeometry_handleKeyDown(resolve: function, reject: function): RemovableHandle
  • Handles keyboard input for plotting polygons, polylines and multipoints.

    Parameters

    • resolve: function
        • (result: Geometry | Promise<Geometry>): void
        • Parameters

          • result: Geometry | Promise<Geometry>

          Returns void

    • reject: function
        • (error: any): void
        • Parameters

          • error: any

          Returns void

    Returns RemovableHandle

Protected _editShape

  • _editShape(geometry: Geometry): void
  • Parameters

    • geometry: Geometry

    Returns void

Protected _finishKeyboardDrawing

  • _finishKeyboardDrawing(raiseDrawCompleteEvent?: boolean): void
  • Parameters

    • Optional raiseDrawCompleteEvent: boolean

    Returns void

Protected _getEditMode

  • _getEditMode(geometryType: string): object
  • Parameters

    • geometryType: string

    Returns object

    • mode: number
    • Optional options?: EditOptions

Protected _moveVertexAnchor

  • _moveVertexAnchor(dx: number, dy: number): void
  • Parameters

    • dx: number
    • dy: number

    Returns void

Private _onClickHandler

  • _onClickHandler(event: AGSMouseEvent): void
  • GVH measurement tools rely on private/unsupported methods of the Esri Draw object. This is one of them.

    Parameters

    • event: AGSMouseEvent

    Returns void

Private _onEditShapeCompleted

  • _onEditShapeCompleted(tool: number, graphic: Graphic, info: object): void
  • Raises the draw-end event after editing is completed.

    Parameters

    • tool: number
    • graphic: Graphic
    • info: object
      • Optional cancelled?: boolean
      • isModified: boolean

    Returns void

Protected _onKeyDown

  • _onKeyDown(event: KeyboardEvent): void
  • Provides keyboard handling for the Draw component.

    Parameters

    • event: KeyboardEvent

    Returns void

Protected _onKeyUp

  • _onKeyUp(event: KeyboardEvent): void
  • Internal method that subclasses should override to provide keyboard handling.

    Parameters

    • event: KeyboardEvent

    Returns void

Protected _onMapClick

  • _onMapClick(evt: AGSMouseEvent): void
  • Handles map clicks (or taps) occuring while the draw tool is active. The purpose of this handler is to sanity check input in the face of very different firing patterns on different devices and also to inform other consumers about the (sanitized) progress of the draw session.

    Parameters

    • evt: AGSMouseEvent

    Returns void

Protected _onMapDoubleClick

  • _onMapDoubleClick(evt: AGSMouseEvent): void
  • Handles map double clicks (or taps) occuring while the draw tool is active. The purpose of this handler is to sanity check input in the face of very different firing patterns on different devices and also to inform other consumers about the (sanitized) progress of the draw session.

    Parameters

    • evt: AGSMouseEvent

    Returns void

Protected _plotShape

  • _plotShape(location: Point, geometryType: string): Promise<Geometry>
  • Plots a shape on the map. It will produce either a default shape (e.g. circle) or a shape digitized via the keyboard (e.g. polygon)

    Parameters

    • location: Point
    • geometryType: string

    Returns Promise<Geometry>

Protected _supportsKeyboardInput

  • _supportsKeyboardInput(geometryType: string): boolean
  • Whether keyboard input is supported for the specified geometry type. Keyboard input is not supported for freehand drawing.

    Parameters

    • geometryType: string

    Returns boolean

Protected _syncPointsCollection

  • _syncPointsCollection(): void
  • Returns void

Protected _toPolygon

  • _toPolygon(ring: number[][], dx: number, dy: number): Polygon
  • Parameters

    • ring: number[][]
    • dx: number
    • dy: number

    Returns Polygon

Private _updateGhostLine

  • _updateGhostLine(vertexLocation: Point): void
  • Parameters

    • vertexLocation: Point

    Returns void

Protected _vertexCount

  • _vertexCount(g: Geometry): number
  • Parameters

    • g: Geometry

    Returns number

activate

  • Activates the toolbar for drawing geometries.

    Parameters

    • geometryType: string

      The type of geometry drawn.

    • Optional options: ExtendedDrawOptions

      Options that define the functionality of the draw toolbar.

    Returns void

activateKeyboardControls

  • activateKeyboardControls(resetInputMode?: boolean): void

activateMouseControls

  • activateMouseControls(resetInputMode?: boolean): void

deactivate

  • deactivate(): void
  • Deactivates the toolbar and reactivates map navigation.

    Returns void

deactivateKeyboardControls

  • deactivateKeyboardControls(resetInputMethod?: boolean): void

deactivateMouseControls

  • deactivateMouseControls(resetInputMode?: boolean): void

disableMapNavigation

  • disableMapNavigation(hideZoomSlider?: boolean, hidePanArrows?: boolean, disableGraphicMouseEvents?: boolean): MapNavigationState

enableMapNavigation

  • enableMapNavigation(showZoomSlider?: boolean, showPanArrows?: boolean, enableGraphicMouseEvents?: boolean, mapState?: MapNavigationState): void

finishDrawing

  • finishDrawing(): void
  • Finishes drawing the geometry and fires the onDrawEnd event.

    Returns void

getMapState

on

  • on(type: "draw-complete", listener: function): Handle
  • on(type: "draw-end", listener: function): Handle
  • on(type: string, listener: function): Handle
  • Fired when drawing is complete.

    Parameters

    • type: "draw-complete"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • geographicGeometry: Geometry
            • geometry: Geometry
            • target: Draw

          Returns void

    Returns Handle

  • Fired when drawing is complete. DEPRECATED

    Parameters

    • type: "draw-end"
    • listener: function
        • (event: object): void
        • Parameters

          • event: object
            • geometry: Geometry
            • target: Draw

          Returns void

    Returns Handle

  • Parameters

    • type: string
    • listener: function
        • (event: any): void
        • Parameters

          • event: any

          Returns void

    Returns Handle

onActivate

  • onActivate(): void
  • Fired when the drawing tools are activated.

    Returns void

onDeactivate

  • onDeactivate(): void
  • Fired when the drawing tools are deactivated.

    Returns void

onDrawComplete

  • onDrawComplete(result: object): void
  • Fired when the user has ended drawing.

    Parameters

    • result: object

      The event object has the following properties: geometry, geographicGeometry. geometry represents the shape that was drawn. Coordinates of this geometry have the same spatial reference of the map. geographicGeometry represents the drawn shape in geographic coordinates (latitude, longitude). Only available when the map's spatial reference is Web Mercator or Geographic (4326)

      • geographicGeometry: Geometry
      • geometry: Geometry

    Returns void

onDrawEnd

  • onDrawEnd(): void
  • DEPRECATED: but may still have listeners

    Returns void

onInputMethodChange

  • onInputMethodChange(result: object): void
  • Fired when the input method for this component (e.g. keyboard, mouse) has changed.

    Parameters

    • result: object
      • newMethod: string
      • previousMethod: string

    Returns void

onKeyboardStart

  • onKeyboardStart(): void

onKeyboardStop

  • onKeyboardStop(cancelled?: boolean): void
  • Internal method that subclasses should override to provide keyboard handling.

    Parameters

    • Optional cancelled: boolean

      Whether the operation was cancelled.

    Returns void

raiseGraphicDrawActivated

raiseGraphicDrawDeactivated

raiseGraphicVertexAdded

raiseGraphicVertexMoved

resume

  • resume(): void

setApp

setFillSymbol

  • setFillSymbol(fillSymbol: SimpleFillSymbol): void
  • Sets the fill symbol.

    Parameters

    • fillSymbol: SimpleFillSymbol

      The fill symbol.

    Returns void

setInputMethod

  • setInputMethod(method: string): void
  • Sets the current input method for this component (for example, mouse or keyboard).

    Parameters

    • method: string

      The input method. See {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.accessibility.InputMethod} for valid values.

    Returns void

setKeyboardActive

  • setKeyboardActive(value: boolean): void

setLineSymbol

  • setLineSymbol(lineSymbol: SimpleLineSymbol): void
  • Sets the line symbol.

    Parameters

    • lineSymbol: SimpleLineSymbol

      The line symbol.

    Returns void

setMap

  • setMap(map: Map): void

setMarkerSymbol

  • setMarkerSymbol(markerSymbol: SimpleMarkerSymbol): void
  • Sets the marker symbol.

    Parameters

    • markerSymbol: SimpleMarkerSymbol

      The marker symbol.

    Returns void

setRespectDrawingVertexOrder

  • setRespectDrawingVertexOrder(value: boolean): void
  • Sets whether the polygon geometry should be modified to be topologically correct.

    Parameters

    • value: boolean

      When set to false, the geometry is modified to be topologically correct.

    Returns void

setSelectedVertexSymbol

  • setSelectedVertexSymbol(markerSymbol: SimpleMarkerSymbol): void
  • Sets the vertex highlight marker symbol.

    Parameters

    • markerSymbol: SimpleMarkerSymbol

      The marker symbol.

    Returns void

setVertexSymbol

  • setVertexSymbol(markerSymbol: SimpleMarkerSymbol): void
  • Sets the vertex marker symbol.

    Parameters

    • markerSymbol: SimpleMarkerSymbol

      The marker symbol.

    Returns void

suspend

  • suspend(): void

toggleKeyboardMode

  • toggleKeyboardMode(): void