UNPKG

@arcgis/map-components

Version:
139 lines (137 loc) 5.63 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { default as HomeViewModel } from '@arcgis/core/widgets/Home/HomeViewModel.js'; import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useHomeViewModel: (component: LitElement & Pick<HomeViewModel, never> & import('../../controllers/useViewModel').ViewModelControllerUses<HomeViewModel>) => HomeViewModel; /** * The Home component is a button that navigates back to the * initial [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * or a previously defined `viewpoint`. * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-home/) * * @example * ```js * // Create viewpoint centered on extent of a polygon geometry * * let vp = new Viewpoint({ * targetGeometry: geom.extent * }); * * // Sets the Home's viewpoint to that Viewpoint * home.viewpoint = vp; * ``` */ export declare class ArcgisHome 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-home/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * 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-Home-HomeViewModel.html#goToOverride) */ goToOverride: nullish | __esri.GoToOverride; /** * 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 "home" */ 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; /** * 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 current state of the component. * * @default "disabled" */ readonly state: "ready" | "disabled" | "going-home"; /** * The [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html) * to go to when going "home". * The initial value is determined in a few different ways: * * If no referenceElement is provided, the value is `null`. * Once the referenceElement is ready, the initial viewpoint value is the user-defined [Viewpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html). * * @example * ```js * // Create viewpoint centered on extent of a polygon geometry * * let vp = new Viewpoint({ * targetGeometry: geom.extent * }); * * // Sets the Home's viewpoint to that Viewpoint * home.viewpoint = vp; * ``` * @default null */ viewpoint: nullish | __esri.Viewpoint; /** * This function provides the ability to interrupt and cancel the process * of navigating back to the initial extent. */ cancelGo(): Promise<void>; /** Permanently destroy the component. */ destroy(): Promise<void>; /** * Animates the map or scene to its initial Viewpoint or the * value of `viewpoint`. */ go(): Promise<void>; /** * Fires when the go() method is called. * * @example * ```js * home.addEventListener("arcgisGo", (event) => { * console.log("updating viewpoint"); * }); * ``` */ readonly arcgisGo: TargetedEvent<this, __esri.HomeViewModelGoEvent>; /** 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; title: string; cancel: string; }> & import('@arcgis/lumina/controllers').T9nMeta<{ componentLabel: string; title: string; cancel: string; }>; } export {};