UNPKG

@arcgis/map-components

Version:
168 lines (166 loc) 8.15 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { default as TrackViewModel } from '@arcgis/core/widgets/Track/TrackViewModel.js'; import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useTrackViewModel: (component: LitElement & Pick<TrackViewModel, never> & import('../../controllers/useViewModel').ViewModelControllerUses<TrackViewModel>) => TrackViewModel; /** * The Track component is a button that when activated continuously animates the Map or Scene * to the user's location as the user moves. * The view rotates based on device heading, and the default heading symbol will display * when speed is greater than zero and the browser provides heading information. * * This component uses the browser's [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API) which is only available in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts), such as HTTPS. * Note that localhost is considered "potentially secure" and can be used for easy testing in browsers that support * [Window.isSecureContext](https://developer.mozilla.org/en-US/docs/Web/API/isSecureContext#browser_compatibility). * * **Known limitations** * * - The heading symbol is not currently supported within a [Scene component](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/). * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-track/) */ export declare class ArcgisTrack 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-track/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * Error that caused the last [track-error](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event:track-error) event to fire. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#error) * * @default null */ error: any; /** * An object used for setting optional position parameters. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#geolocationOptions) * * @default null */ geolocationOptions: any; /** * This function provides the ability to override either the * [MapView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo) or * [SceneView goTo()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#goTo) methods. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#goToOverride) */ goToOverride: nullish | __esri.GoToOverride; /** * Indicates whether to navigate the view to the position and scale of the geolocated result. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#goToLocationEnabled) * * @default false */ goToLocationDisabled: boolean; /** * The graphic used to show the user's location on the map. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#graphic) */ graphic: __esri.Graphic; /** @default "compass-north-circle" */ icon?: string; /** The component's default label. */ label?: string; /** * Replace localized message strings with your own strings. * * _**Note**: Individual message keys may change between releases._ */ messageOverrides?: typeof this.messages._overrides; /** @default "top-left" */ position: __esri.UIPosition; /** * A function that is used as an expression to evaluate geolocation points, and returns a boolean * value. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#positionFilterFunction) * * @default null */ positionFilterFunction: Function | nullish; /** * 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; /** * Indicates whether the component will automatically rotate to the device heading based on * the Geolocation APIs [`GeolocationCoordinates.heading`](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/heading) * property. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#rotationEnabled) * * @default false */ rotationDisabled: boolean; /** * Indicates the scale to set on the view when navigating to the position of the geolocated * result, after a location is returned from the [track](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event-track) event. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#scale) * * @default null */ scale: number | nullish; /** * The current state of the component. * * @name state * @instance * @type {"disabled" | "ready" | "tracking" | "waiting" | "feature-unsupported" | "error"} * @default "disabled" */ readonly state: "ready" | "disabled" | "error" | "tracking" | "waiting" | "feature-unsupported"; /** * Indicates whether new positions are being watched. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#tracking) * * @default false */ readonly tracking: boolean; /** Permanently destroy the component. */ destroy(): Promise<void>; /** Start tracking the user's location. Only start the component on a user gesture such as a click event. */ start(): Promise<void>; /** Stop tracking the user's location. */ stop(): Promise<void>; readonly arcgisComplete: TargetedEvent<this, __esri.TrackViewModelTrackEvent>; readonly arcgisError: TargetedEvent<this, __esri.TrackViewModelTrackErrorEvent>; /** 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>; private messages: Partial<{ componentLabel: string; startTracking: string; stopTracking: string; permissionError: string; timeoutError: string; positionUnavailable: string; }> & import('@arcgis/lumina/controllers').T9nMeta<{ componentLabel: string; startTracking: string; stopTracking: string; permissionError: string; timeoutError: string; positionUnavailable: string; }>; } export {};