UNPKG

@arcgis/map-components

Version:
140 lines (138 loc) 6.02 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { default as Legend } from '@arcgis/core/widgets/Legend.js'; import { PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; declare const useLegendWidget: (component: LitElement & Pick<Legend, "icon" | "label" | "viewModel" | "headingLevel" | "activeLayerInfos" | "basemapLegendVisible" | "hideLayersNotInCurrentView" | "layerInfos" | "respectLayerDefinitionExpression"> & { state?: unknown; viewModel?: __esri.LegendViewModel | 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>; }) => Legend; /** * The Legend component describes the symbols used to represent layers in a map. * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-legend/) */ export declare class ArcgisLegend extends LitElement { /** * Collection of [ActiveLayerInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend-support-ActiveLayerInfo.html) objects used by the legend view to * display data in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#activeLayerInfos) */ activeLayerInfos: __esri.Collection<__esri.ActiveLayerInfo>; /** * 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-legend/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * Indicates whether to show the [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) layers in the Legend. * * @default false */ basemapLegendVisible: boolean; /** * Indicates the heading level to use for the legend title. * * @default 3 */ headingLevel: number; /** * When `true`, layers will only be shown in the legend if * they are visible in the view's extent. * * @default false */ hideLayersNotInCurrentView: 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 "legend" */ icon: string; /** * The widget's default label. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#label) */ label: string; /** * Specifies a subset of the layers to display in the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#layerInfos) */ layerInfos: __esri.LegendLayerInfos[]; /** * Indicates the style of the legend. * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#style) * * @default "classic" */ legendStyle: string | __esri.LegendStyle; /** @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; /** * If a layer uses a unique value render, only features that satisfy the layer's * [definition expression](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression) * will be displayed in the legend when set to true. * * @default false */ respectLayerDefinitionExpression: boolean; /** * Determines whether to respect the properties of the layers in the map that * control the legend's visibility (`minScale`, `maxScale`, `legendEnabled`). * * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Legend.html#respectLayerVisibility) * * @default false */ respectLayerVisibilityDisabled: boolean; /** * The current state of the component. * * @default "disabled" */ readonly state: "ready" | "disabled"; /** Permanently destroy the component. */ destroy(): 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 {};