UNPKG

@arcgis/map-components

Version:
92 lines (90 loc) 4.3 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/components-controllers'; import { Nil } from '@arcgis/components-utils'; import { default as ScaleBarViewModel } from '@arcgis/core/widgets/ScaleBar/ScaleBarViewModel.js'; import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; import { MeasurementSystem } from '../types'; type ScaleBarStyle = "line" | "ruler"; type ScaleBarUnit = MeasurementSystem | "dual"; declare const useScaleBarViewModel: (component: import('@arcgis/components-controllers').StencilLifecycles & { manager: import('@arcgis/components-controllers').ControllerManager; el: HTMLElement; autoDestroyDisabled?: boolean; destroy?: () => Promise<void>; } & Pick<ScaleBarViewModel, never> & { reactiveUtils?: typeof __esri.reactiveUtils; state?: "ready" | "disabled" | undefined; icon: Nil | string; label: Nil | string; referenceElement: ArcgisReferenceElement | Nil | string; arcgisReady: import('@arcgis/components-controllers').EventEmitter; position: __esri.UIPosition; arcgisPropertyChange: import('@arcgis/components-controllers').EventEmitter<{ name: string; }> | undefined; el: HTMLElement & { childElem?: HTMLElement & { ownedBy?: HTMLElement; }; view?: __esri.MapView | __esri.SceneView | undefined; }; autoDestroyDisabled: boolean; destroy: () => Promise<void>; }, options?: { editConstructorProperties(props: unknown): unknown; } | undefined) => ScaleBarViewModel; /** * The Scale Bar componenent displays a scale bar representing the scale of the map. * It respects various coordinate systems and displays units in metric or imperial values. * Metric values show either kilometers, meters, centimeters, or millimeters depending on the scale, and likewise, imperial values show miles, feet, or inches depending on the scale. * When working with Web Mercator or geographic coordinate systems the scale bar takes into account projection distortion and dynamically adjusts the scale bar. * * When the scale bar is inside the map, the actual location of the scale bar is used to calculate the scale. * Otherwise, the center of the map is used to calculate the scale. * * **Known Limitations** * * - This component is not currently supported within an `arcgis-scene` component. */ export declare class ArcgisScaleBar extends LitElement { private messages; /** * 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 * temporary hide it. If this is set, make sure to call the * \`destroy\` method when you are done to prevent memory leaks. */ autoDestroyDisabled: boolean; /** * The style for the scale bar. * When `unit` is set to `dual`, the style will always be `line`. */ barStyle: ScaleBarStyle; /** * Icon which represents the component. * Typically used when the component is controlled by another component (e.g. by the Expand component). * Search [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) for possible values. */ icon: Nil | string; /** The component's default label. */ label: Nil | string; /** Replace localized message strings with your own strings. */ messageOverrides?: typeof this.messages._overrides; position: __esri.UIPosition; referenceElement: ArcgisReferenceElement | Nil | string; /** * Units to use for the scale bar. * When using `dual`, the scale bar displays both metric and imperial units. * When metric, distances will be shown in either kilometers, meters, centimeters, or millimeters depending on the scale. Similarly, imperial * units will be shown in either miles, feet, or inches. */ get unit(): ScaleBarUnit | undefined; set unit(value: ScaleBarUnit | undefined); /** Permanently destroy the component */ destroy(): Promise<void>; readonly arcgisReady: TargetedEvent<this, undefined>; } export {};