UNPKG

@arcgis/map-components

Version:
186 lines (184 loc) 9.34 kB
/// <reference types="@arcgis/core/interfaces.d.ts" /> /// <reference types="../../index.d.ts" /> import { Use } from '@arcgis/lumina/controllers'; import { PublicLitElement as LitElement, JsxNode, TargetedEvent } from '@arcgis/lumina'; import { ArcgisReferenceElement } from '../../utils/component-utils'; import { default as SliceViewModel, SliceableLayer } from './SliceViewModel'; import { HeadingLevel } from '../../support/heading'; declare const useSliceViewModel: (component: LitElement & Pick<SliceViewModel, never> & import('../../controllers/useViewModel').ViewModelControllerUses<SliceViewModel>) => SliceViewModel; /** * The Slice component is a 3D analysis tool that can be used to reveal occluded content in a * [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/). It applies * [slice analysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html) * to any layer type, making it possible to see inside buildings or to explore geological surfaces. * * [![slice](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/slice.gif)](https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-slice/index.html) * * The slicing [shape](#shape) * is always a [plane](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SlicePlane.html). * By default, the plane is either horizontal or vertical. To allow a tilt angle for the plane, set * [tiltEnabled](#tiltEnabled) * to `true`. The slice hides any content in front of the surface. The handles on the sides of the plane can be used to adjust * the size, heading, tilt, and position of the slice plane. * The [SlicePlane](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SlicePlane.html) * can be set or retrieved using the [shape](#shape) property. * * Once the slice plane is applied, layers can be excluded from the slicing. For example, by excluding the sublayers which include * columns and floor slabs, the inner structure of a building can investigated. * * [![slice-exclude](https://developers.arcgis.com/javascript/latest/assets/img/apiref/widgets/slice-exclude.png)](https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-slice/index.html) * * Holding the `Shift` key while creating a new slice applies it vertically. * * **Known limitation** * * Slice is only supported in a 3D [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/) component. * * **See also** * * - [SliceAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html) * - [Sample - BuildingSceneLayer with Slice component](https://developers.arcgis.com/javascript/latest/sample-code/building-scene-layer-slice/) * - [Sample - Analysis objects](https://developers.arcgis.com/javascript/latest/sample-code/analysis-objects/) * * [Read more...](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-slice/) */ export declare class ArcgisSlice extends LitElement { /** * The [SliceAnalysis](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html) * created or modified by the component. * * When connecting the Slice component to the [Scene](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/) * component, it automatically creates an empty analysis and adds it to the Scene's * [analyses](https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-scene/#analyses) collection. * Whenever the component is destroyed, the analysis is automatically removed from the collection. * * Alternatively, a programmatically created analysis can be provided to the component. * Then, the application itself needs to add it to and later remove it from the Scene's analyses collection. * * ```js * // Create the analysis. * const sliceAnalysis = new SliceAnalysis({ * shape: new SlicePlane({ * position: new Point({ * spatialReference: { latestWkid: 3857, wkid: 102100 }, * x: -13624925.727820931, * y: 4550341.695170021, * z: 56 * }), * tilt: 270, * width: 310, * height: 190, * heading: 45 * }) * }); * // Get the Scene and Slice component and wait until they are ready. * const viewElement = document.querySelector("arcgis-scene"); * await viewElement.viewOnReady(); * const slice = document.querySelector("arcgis-slice"); * await slice.componentOnReady(); * // Add the analysis to the Scene component. * viewElement.analyses.add(sliceAnalysis); * // Connect the analysis to the slice component: * slice.analysis = sliceAnalysis; * ``` */ analysis: __esri.SliceAnalysis; /** * 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-slice/#destroy) method when you are done to * prevent memory leaks. * * @default false */ autoDestroyDisabled: boolean; /** * Indicates whether the [Ground](https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) and layers that * are draped on the ground surface are excluded from the slice. * * @default false */ excludeGroundSurface: boolean; /** * Add layers to this collection to exclude them from the slice. Layers that * are draped on the ground surface are not affected by this property */ excludedLayers: __esri.Collection<SliceableLayer>; /** @default 3 */ headingLevel: HeadingLevel; /** * 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 "slice" */ icon?: HTMLCalciteIconElement["icon"]; /** 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 "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; /** * The shape used to slice elements in a 3D scene. Currently the only supported shape is a * [plane](https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SlicePlane.html). * * @example * ```js * // Clone the shape to modify its properties * const shape = slice.shape.clone(); * // Set new values for heading and tilt * shape.heading = 180; * shape.tilt = 45; * // Apply the new shape to the slice component's shape * slice.shape = shape; * ``` */ shape: nullish | __esri.SlicePlane; /** * The component's state. The values mean the following: * * * `disabled` - not ready yet * * `ready` - ready for slicing * * `slicing` - currently slicing * * `sliced` - finished slicing */ readonly state: "ready" | "disabled" | "excludingLayer" | "sliced" | "slicing"; /** * Enable tilting the slice shape. If set to true, the slice shape will orient itself as best as * possible to the surface under the cursor when first placing the shape. If set to false, the slice shape is * restricted to be either horizontal or vertical. * * @default false */ tiltEnabled: boolean; /** * Clear the [shape](#shape) of the slice, effectively removing it from the view. Other properties like [excludedLayers](#excludedLayers) * and [excludeGroundSurface](#excludeGroundSurface) are not modified. */ clear(): Promise<void>; /** Permanently destroy the component. */ destroy(): Promise<void>; /** Start the interactive creation of a new slice, clearing the previous [shape](#shape). */ start(): 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" | "analysis"; }>; /** 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; } export {};