import SketchTooltipOptions from "@arcgis/core/views/interactive/sketch/SketchTooltipOptions.js";
Inheritance
SketchTooltipOptions→Accessor
Since
ArcGIS Maps SDK for JavaScript 4.24

The SketchTooltipOptions allows users to configure the tooltips which are shown while sketching and editing.

To enter the tooltip UI's input mode, press the Tab key while drawing a new feature, or when editing a point, mesh, or a selected vertex.

Available tooltip inputs and constraints

Direction field and its respective constraint controls the direction (angle) of a segment (applies to polylines/polygons while drawing).
It has two options that can be set either in the tooltip's UI or with valueOptions:

  • Deflection – relative angle that is measured from the previous segment (default). Positive values are measured in a clockwise direction. Negative values are measured in a counterclockwise direction.
  • Direction – absolute angle that is measured clockwise from the main axis of the map (typically north).

Distance field and its respective constraint controls the length of a segment (applies to polylines/polygons while drawing). Distance field is also shown when editing an edge offset in SceneView.

Coordinates fields edit the longitude and latitude (in geographic coordinate systems and in Web Mercator) or X and Y values (in projected coordinate systems) of a point or a vertex of a polyline/polygon.
The coordinates can be entered as separate values or as a latitude+longitude pair. In case of the latter, the pair can be typed or pasted into either of the two coordinate fields and the input is converted to decimal degree format. The coordinates may use DD (decimal degrees), DDM (degrees and decimal minutes), or DMS (degrees, minutes, and seconds) format. See more about supported latitude/longitude strings.

Elevation (Z) field and its respective constraint edits the Z value of a point or a vertex of a polyline/polygon geometry.
When drawing polygon or polyline segments, the Z (elevation) field is locked by default. This means that all vertices use the Z value of the first vertex. The constraint can be unlocked in the tooltips' input mode.

Orientation field edits the orientation of a mesh. The angle is measured clockwise from the main axis of the map (typically north).
Note that the orientation field is connected to the mesh geometry's rotation transform property. The latter is an arithmetic rotation which is measured counterclockwise from the 3 o'clock position (typically east).

Scale field edits the scale of a mesh.

The following fields are read-only: Total length (for polylines only), Area (for polygons only), or fields shown when dragging the manipulators, such as relative Distance, Radius, relative Rotation, relative Scale, and Size.

Considerations when using distance, direction, and deflection constraints
  • In geographic coordinate systems (GCS) and in Web Mercator, the constraints are computed geodetically.
  • In projected coordinate systems (PCS), apart from Web Mercator, the constraints are computed in a Euclidean manner (in the respective PCS).
  • In 3D, the distance, direction, and deflection constraints are computed on a horizontal plane, dependent on the view's spatial reference.

Available gestures

GestureAction
TabActivates the input mode and focuses on the next field.
Input value + TabApplies the constraint and focuses on the next field.
Empty value + TabRemoves the constraint and focuses on the next field.
Input value + EnterApplies the constraint and closes the input mode.
Empty value + EnterRemoves the constraint and closes the input mode.
Lock iconToggles the constraint on and off.
EscCloses the input mode but keeps any applied constraints.
Left-click-drag (on tooltip header)Allows to change the position of the tooltip in input mode.
See also

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

enabled

Property
Type
boolean

Whether tooltips are shown while sketching and editing.

Default value
false

helpMessage

Property
Type
string | null | undefined

A custom help message that is displayed at the bottom of the tooltip. If not set, the default help message based on the current state of the tool is shown.

helpMessageIcon

Property
Type
Icon["icon"] | null | undefined

An icon that is displayed next to the help message at the bottom of the tooltip. If not set, the default info icon is shown.

inputEnabled

Property
Type
boolean

Whether users can focus the tooltip and input constraint values.

Default value
true

visibleElements

autocast Property
Type
SketchTooltipVisibleElements

The elements that are displayed within the tooltip while sketching.