import ViewOptions from "@arcgis/core/views/interactive/options/ViewOptions.js";
Inheritance
ViewOptions→Accessor
Since
ArcGIS Maps SDK for JavaScript 5.2
beta

Configures snapping, tooltips, display units, and input units for supported components, view models, and analyses through View.options.

Unlike inherited snapping and tooltip options, display and input units can be overridden individually through unit properties exposed by a component, view model, or analysis. For example, setting DistanceMeasurementAnalysis.unit to feet overrides view.options.displayUnits.length for that analysis without changing the view's configuration or other analyses. Setting the analysis unit back to null restores the unit configured through view.options.displayUnits.length.

These options are not saved in a WebMap or WebScene.

The following table shows which components, view models, and analyses inherit each option from view.options.

  • ✓: The option is inherited, with explicit component, view model, or analysis units taking precedence as described above.
  • Opt-in: The option is inherited only when the component's or view model's useViewOptions property is true.
  • ✗: The capability exists but does not inherit the option from the view. See the corresponding footnote.
  • N/A: The capability is unavailable for that component or analysis (for example, Area Measurement 3D does not support tooltips at all).
Component or analysisInherits view.options.snappingInherits view.options.tooltipsInherits view.options.displayUnitsInherits view.options.inputUnits
Area Measurement 2D✗¹✓✓✓
Area Measurement 3D✓N/A✓N/A
Distance Measurement 2D✗¹✓✓✓
Direct Line Measurement 3D✓N/A✓N/A
Elevation Profile✓N/A✓N/A
Line of Sight✓✓✓✓
Viewshed✓✓✓✓
Length Dimension✓N/A✓N/A
Volume Measurement✓✗²✓✓
SketchOpt-in³Opt-in³Opt-in³Opt-in³
EditorOpt-in³Opt-in³Opt-in³Opt-in³
  1. For 2D measurements, configure snapping through the component's own snappingOptions, AreaMeasurementAnalysisView2D.snappingOptions, or DistanceMeasurementAnalysisView2D.snappingOptions. Support for view.options.snapping is planned for a future release.

  2. The Volume Measurement cut-fill elevation tooltip remains enabled independently of view.options.tooltips.

  3. For Sketch and Editor, including SketchViewModel and EditorViewModel, set the component's or view model's useViewOptions property to true (default: false) to use options on the view. Changes to this property apply to the next create or update operation, not an operation already in progress.

    When this property is true:

    • Snapping and tooltip options specified on the component or view model are preserved but ignored.
    • The corresponding controls in the component's Settings menu are hidden.
    • Where unit properties are exposed, explicit units override those configured through view.options per measurement type.
    • Set an explicit unit to null or undefined to use the unit from view.options for that measurement type again.
See also

Constructors

Constructor

Constructor

Parameters

ParameterTypeDescriptionRequired
properties

The initial snapping, tooltip, and unit options.

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
Since
ArcGIS Maps SDK for JavaScript 4.7

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

displayUnits

autocast Property
Type
Units

Units for displaying measurements, such as lengths, areas, and volumes.

Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis. A display unit set directly on a component, view model, or analysis overrides the corresponding unit on the view, without changing the view's options or the units used by other components, view models, or analyses.

inputUnits

autocast Property
Type
Units

Units for interpreting numeric values entered by the user.

Input units may differ from displayUnits. Each unit can be configured independently. Unset units use the defaults of the component, view model, or analysis. An input unit set directly on a component, view model, or analysis overrides the corresponding unit on the view, without changing the view's options or the units used by other components, view models, or analyses. These options control numeric input in the UI, not the spatial reference or stored coordinates of a geometry.

snapping

autocast Property
Type
SnappingOptions

Options for snapping to geometry guides and features.

Snapping is disabled by default in a MapView and enabled by default in a SceneView.

Known Limitations

These options currently do not apply to AreaMeasurementAnalysisView2D or DistanceMeasurementAnalysisView2D, including their measurement components. Configure snappingOptions on the analysis view or component instead. Tooltip and unit options configured through view.options still apply. Support for view.options.snapping in these analyses and components is planned for a future release.

tooltips

autocast Property
Type
TooltipOptions

Options for tooltips shown while sketching, editing, or placing analyses.

Tooltips are disabled by default in both MapView and SceneView.

Known Limitations

The Volume Measurement cut-fill elevation tooltip remains enabled independently of these options. Its display and input units can still inherit ViewOptions.displayUnits and ViewOptions.inputUnits.