UNPKG

@arcgis/map-components

Version:
237 lines (236 loc) • 9.77 kB
/// <reference path="../../index.d.ts" /> import type MapView from "@arcgis/core/views/MapView.js"; import type { PublicLitElement as LitElement } from "@arcgis/lumina"; import type { ArcgisReferenceElement, IconName } from "../types.js"; import type { UtilityNetworkTraceViewModelRemoveResultAreaEvent, UtilityNetworkTraceViewModelAddResultAreaEvent, UtilityNetworkTraceViewModelAddFlagErrorEvent, UtilityNetworkTraceViewModelAddFlagCompleteEvent, UtilityNetworkTraceViewModelAddFlagEvent, TraceResultExtend, GraphicColor, FlagProperty, ResultAreaPropertiesExtend, UtilityNetworkTraceViewModelState } from "@arcgis/core/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js"; import type { Icon } from "@esri/calcite-components/components/calcite-icon"; import type { InputSetting } from "@arcgis/core/widgets/UtilityNetworkTrace.js"; /** * > [!WARNING] * > * > This component is **deprecated**. [arcgis-utility-network-trace-analysis](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-analysis/) is the preferred component for utility network tracing and should be used for all new development. * * Utility Network Trace component provides a way to run traces in a Utility Network based on connectivity or traversability from set trace locations. Trace locations (starting points and barriers) can be set by clicking the view. * * > The Utility Network Trace component does not support proxied feature services or feature services that utilize stored credentials. * * Note: Sign in to access the data in this sample, U/P: `viewer01`/`I68VGU^nMurF` * * @deprecated since 5.0, use [arcgis-utility-network-trace-analysis](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-utility-network-trace-analysis/) instead. * @since 4.28 */ export abstract class ArcgisUtilityNetworkTrace 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/components/arcgis-utility-network-trace/#destroy) method when you are done to * prevent memory leaks. * * @default false */ accessor autoDestroyDisabled: boolean; /** * The default color to assign the aggregated geometry of a trace result. * * @default * { * color: [255, 255, 0, 0.6], * haloOpacity: 0.9, * fillOpacity: 0.2, * hex: "#FFFF00" * } * @since 4.23 */ accessor defaultGraphicColor: GraphicColor; /** * When true, the component is visually withdrawn and cannot receive user interaction. * * @default false * @since 4.22 */ accessor disabled: boolean; /** * When `true`, provides the ability to show the convex hull or buffer. * * @default false * @since 4.27 */ accessor enableResultArea: boolean; /** * An array of map points to load into the component to lookup flags. * * @default [] * @since 4.22 * @example * const unt = new UtilityNetworkTrace({ * view: view, * showSelectionAttributes: true, * selectOnComplete: true, * showGraphicsOnComplete: true, * selectedTraces: ["{E8D545B8-596D-4656-BF5E-16C1D7CBEC9B}"], * flags: [ * { * type: "starting-point", * mapPoint: { * spatialReference: { latestWkid: 3857, wkid: 102100 }, * x: -9814829.166046409, * y: 5127094.1017433 * } * }, * { * type: "barrier", * mapPoint: { * spatialReference: { latestWkid: 3857, wkid: 102100 }, * x: -9814828.449441982, * y: 5127089.085566963 * } * } * ] * }); */ accessor flags: Array<FlagProperty>; /** * Icon which represents the component. * Typically used when the component is controlled by another component (e.g. by the Expand component). * * @default "utility-network-trace" * @since 4.27 * @see [Calcite Icons](https://developers.arcgis.com/calcite-design-system/icons/) */ get icon(): Icon["icon"]; set icon(value: IconName); /** * Custom labels, descriptions, and symbol for the input [flags](https://developers.arcgis.com/javascript/latest/references/core/widgets/UtilityNetworkTrace/#flags). * * @default [] * @since 4.23 */ accessor inputSettings: Array<InputSetting>; /** * The component's default label. * * @since 4.11 */ accessor label: string; /** * 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) */ accessor referenceElement: ArcgisReferenceElement | string | undefined; /** * The properties to determine the size and color of the result area convex hull or buffer, and determines if it displays on the map when the trace completes. * * @default * { * type: "convexhull", * distance: 10, * unit: "meters", * areaUnit: "square-meters", * color: { * color: [255, 165, 0, 0.5], * haloOpacity: 0.9, * fillOpacity: 0.2, * hex: "#ffa500" * }, * show: false * } * @since 4.27 * @example * const unt = new UtilityNetworkTrace({ * un: un, * view: view, * enableResultArea: true, * resultAreaProperties: { * type: "buffer", * distance: 10, * unit: "feet", * areaUnit: "square-feet", * color: { * color: [255, 165, 0, 0.5], * haloOpacity: 0.9, * fillOpacity: 0.2, * hex: "#ffa500" * }, * show: true * } * }); */ accessor resultAreaProperties: ResultAreaPropertiesExtend; /** * A list of global Ids of traces to select on load * * @default [] * @since 4.22 * @example * const unt = new UtilityNetworkTrace({ * view: view, * selectedTraces: ["{E8D545B8-596D-4656-BF5E-16C1D7CBEC9B}"] * }); */ accessor selectedTraces: Array<string>; /** * When true, the utility network elements are selected in the view when traces are completed. * * @default false * @since 4.22 */ accessor selectOnCompleteDisabled: boolean; /** * When true, a graphic layer is added to the view to highlight the utility network elements when traces are completed. * * @default false * @since 4.22 */ accessor showGraphicsOnCompleteDisabled: boolean; /** * Determines whether to show list of selection attributes * * @default false * @since 4.22 */ accessor showSelectionAttributesDisabled: boolean; /** * The current state of the component. * * @default "ready" */ get state(): UtilityNetworkTraceViewModelState; /** * Stores the result of completed traces. * * @since 4.34 */ get traceResults(): TraceResultExtend[]; /** * The view associated with the component. * > **Note:** The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this `view` property which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-utility-network-trace component will be associated with a map or scene component rather than using the `view` property. */ accessor view: MapView | null | undefined; checkCanTrace(): Promise<void>; confirmReset(): Promise<void>; /** Permanently destroy the component. */ destroy(): Promise<void>; "@setterTypes": { icon?: IconName; }; readonly arcgisAddFlag: import("@arcgis/lumina").TargetedEvent<this, UtilityNetworkTraceViewModelAddFlagEvent>; readonly arcgisAddFlagComplete: import("@arcgis/lumina").TargetedEvent<this, UtilityNetworkTraceViewModelAddFlagCompleteEvent>; readonly arcgisAddFlagError: import("@arcgis/lumina").TargetedEvent<this, UtilityNetworkTraceViewModelAddFlagErrorEvent>; readonly arcgisAddResultArea: import("@arcgis/lumina").TargetedEvent<this, UtilityNetworkTraceViewModelAddResultAreaEvent>; /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "state" | "traceResults"; }>; /** Emitted when the component associated with a map or scene view is ready to be interacted with. */ readonly arcgisReady: import("@arcgis/lumina").TargetedEvent<this, void>; readonly arcgisRemoveResultArea: import("@arcgis/lumina").TargetedEvent<this, UtilityNetworkTraceViewModelRemoveResultAreaEvent>; readonly "@eventTypes": { arcgisAddFlag: ArcgisUtilityNetworkTrace["arcgisAddFlag"]["detail"]; arcgisAddFlagComplete: ArcgisUtilityNetworkTrace["arcgisAddFlagComplete"]["detail"]; arcgisAddFlagError: ArcgisUtilityNetworkTrace["arcgisAddFlagError"]["detail"]; arcgisAddResultArea: ArcgisUtilityNetworkTrace["arcgisAddResultArea"]["detail"]; arcgisPropertyChange: ArcgisUtilityNetworkTrace["arcgisPropertyChange"]["detail"]; arcgisReady: ArcgisUtilityNetworkTrace["arcgisReady"]["detail"]; arcgisRemoveResultArea: ArcgisUtilityNetworkTrace["arcgisRemoveResultArea"]["detail"]; }; }