UNPKG

@arcgis/map-components

Version:
105 lines (103 loc) 5.05 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { default as DistanceMeasurement2D } from '@arcgis/core/widgets/DistanceMeasurement2D.js'; import { PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useDistanceMeasurement2dWidget: (component: LitElement & Pick<DistanceMeasurement2D, "icon" | "label" | "viewModel" | "snappingOptions" | "unit" | "unitOptions"> & { state?: unknown; viewModel?: __esri.DistanceMeasurement2DViewModel | undefined; closed?: boolean; icon: import('@arcgis/components-utils').Nil | string; label: import('@arcgis/components-utils').Nil | string; referenceElement?: ArcgisReferenceElement | string; position: __esri.UIPosition; arcgisReady: import('@arcgis/lumina').EventEmitter; arcgisPropertyChange: import('@arcgis/lumina').EventEmitter<{ name: string; }> | undefined; el: HTMLElement & { childElem?: HTMLElement & { ownedBy?: HTMLElement; }; view?: __esri.LinkChartView | __esri.MapView | __esri.SceneView; }; autoDestroyDisabled: boolean; destroy: () => Promise<void>; }) => DistanceMeasurement2D; /** * The Distance Measurement 2D component calculates and displays the distance between two or more points in a [MapView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html). * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-distance-measurement-2d/) */ export declare class ArcgisDistanceMeasurement2d extends LitElement { /** * If true, the component will not be destroyed automatically when it is * disconnected from the document. This is useful when you want to move the * component to a different place on the page, or temporarily hide it. If this * is set, make sure to call the [destroy](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-distance-measurement-2d/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * Icon which represents the component. * Typically used when the component is controlled by another component (e.g. by the Expand component). * * @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) * @default "measure-line" */ icon: string; /** * The widget's default label. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#label) */ label: string; /** @default "bottom-left" */ position: __esri.UIPosition; /** * By assigning the `id` attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene. * * @see [Associate components with a Map or Scene component](https://developers.arcgis.com/javascript/latest/programming-patterns/#associate-components-with-a-map-or-scene-component) */ referenceElement?: ArcgisReferenceElement | string; /** * The [SnappingOptions](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-interactive-snapping-SnappingOptions.html) for sketching. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#snappingOptions) */ snappingOptions: __esri.SnappingOptions; /** * The current state of the component. * * @default "disabled" */ readonly state: "ready" | "disabled" | "measuring" | "measured"; /** * Unit system (imperial, metric) or specific unit used for displaying the distance values. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unit) */ unit: __esri.SystemOrLengthUnit; /** * List of available units and unit systems (imperial, metric) for displaying the distance values. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-DistanceMeasurement2D.html#unitOptions) */ unitOptions: __esri.SystemOrLengthUnit[]; /** Clear the current measurement. */ clear(): Promise<void>; /** Permanently destroy the component. */ destroy(): Promise<void>; /** Starts a new measurement. */ start(): Promise<void>; /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */ readonly arcgisPropertyChange: TargetedEvent<this, { name: "state"; }>; /** Emitted when the component associated with a map or scene view is is ready to be interacted with. */ readonly arcgisReady: TargetedEvent<this, void>; } export {};