import type Accessor from "../../../core/Accessor.js"; /** @since 5.2 */ export interface LabelOptionsProperties extends Partial> {} /** * The `LabelOptions` class allows users to configure the labels which are shown next to each * segment of a graphic while sketching, editing or placing analyses. The labels display each segment's * horizontal length and are not shown for non-planar polygons and polylines. * * [![sketch-3d](https://developers.arcgis.com/javascript/latest/assets/references/core/views/interactive/sketch/sketchlabels.avif)](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/) * * How the segment lengths are computed depends on the view's spatial reference. In geographic coordinate systems (GCS) * and in Web Mercator, the lengths are computed geodetically. In projected coordinate systems (PCS), * apart from Web Mercator, the lengths are computed in a Euclidean manner (in the respective PCS). * * * ## Set the unit system for labels * * Use either a [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) or [PortalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/) to establish the unit system for labels while sketching, editing, or placing analyses. * *
* Read More * * The unit of measurement used in the labels can be programmatically set * through the [PortalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/) of a [Map](https://developers.arcgis.com/javascript/latest/references/core/Map/) by defining the [Portal.units](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#units) property. * * ```js * // Create a PortalItem instance for the map used in the 3D view * view.map.portalItem = new PortalItem({ * portal: { * units: "english" // or "metric" * }, * }); * ``` * * Or, if a [PortalItem](https://developers.arcgis.com/javascript/latest/references/core/portal/PortalItem/) already exists, the [Portal.units](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#units) property can be directly set or changed. * * ```js * // Set the units directly on an existing PortalItem of the 3D view * view.map.portalItem.portal.units = "english" // or "metric" * ``` * * Alternatively, if no [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/) exists, you can set the [Portal.units](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#units) property * from a new default `Portal` created using the [Portal.getDefault()](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#getDefault) method. * * ```js * // Create a new Portal instance and set its units * const portal = Portal.getDefault(); * portal.units = "english" // or "metric" * ``` * *
* * @since 5.2 * @see [Sketch](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/) * @see [SketchViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/Sketch/SketchViewModel/) * @see [TooltipOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/TooltipOptions/) * @see [ValueOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ValueOptions/) * @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) * @see [Sample - Sketch in 3D](https://developers.arcgis.com/javascript/latest/sample-code/sketch-3d/) * @see [Sample - Edit features in 3D with the Editor widget](https://developers.arcgis.com/javascript/latest/sample-code/editor-3d/) */ export default class LabelOptions extends Accessor { /** @since 5.2 */ constructor(properties?: LabelOptionsProperties); /** * Whether labels are shown next to each segment of a geometry while sketching, editing, or placing analyses. * * @default false * @since 5.2 */ accessor enabled: boolean; }