SliceAnalysisView3D

ESM: import SliceAnalysisView3D from "@arcgis/core/views/3d/analysis/SliceAnalysisView3D.js";
CDN: const SliceAnalysisView3D = await $arcgis.import("@arcgis/core/views/3d/analysis/SliceAnalysisView3D.js");
Class: @arcgis/core/views/3d/analysis/SliceAnalysisView3D

Represents the analysis view of a SliceAnalysis after it has been added to SceneView.analyses.

The SliceAnalysisView3D is responsible for rendering a SliceAnalysis using custom visualizations.

It allows to create a new slice interactively using the place() method, exclude layers from slicing using the pickLayerToExclude() method, or make an existing analysis editable by enabling the interactive property.

While multiple SliceAnalysis can be added to SceneView.analyses, only one SliceAnalysis can be actively slicing the scene. The SliceAnalysis which is currently actively slicing the scene can be controlled by setting the active property on its analysis view to true.

The view for an analysis can be retrieved using SceneView.whenAnalysisView similar to how layer views are retrieved for layers using SceneView.whenLayerView.

// retrieve analysis view for analysis
const sliceAnalysis = new SliceAnalysis();
view.analyses.add(sliceAnalysis); // add to the scene view
const sliceAnalysisView = await view.whenAnalysisView(sliceAnalysis);
See also

Property Overview

Name Type Summary Class

Only one SliceAnalysis at a time can be active in a SceneView.

SliceAnalysisView3D

The slice analysis object associated with the analysis view.

SliceAnalysisView3D

Enables interactivity for the associated analysis.

SliceAnalysisView3D
For SliceAnalysisView3D the type is always "slice-view-3d". SliceAnalysisView3D

When true, the analysis is visualized in the view.

SliceAnalysisView3D

Property Details

active

Property
active Boolean

Only one SliceAnalysis at a time can be active in a SceneView. When a slice analysis view is activated by setting this property to true, all other slice analysis views are automatically deactivated.

Default Value:true

analysis

Property
analysis SliceAnalysisreadonly

The slice analysis object associated with the analysis view.

interactive

Property
interactive Boolean

Enables interactivity for the associated analysis. When set to true, manipulators will be displayed, allowing users to click and drag to edit the analysis if it has a valid shape.

This property is automatically set to true when the analysis is assigned to a Slice component.

Default Value:false

type

Property
type Stringreadonly

For SliceAnalysisView3D the type is always "slice-view-3d".

visible

Property
visible Boolean

When true, the analysis is visualized in the view.

Method Overview

Name Return Type Summary Class
Promise<void>

Starts an interactive operation to pick a layer to exclude from the slice analysis.

SliceAnalysisView3D

Starts the interactive placement of a slice plane.

SliceAnalysisView3D

Method Details

pickLayerToExclude

Method
pickLayerToExclude(options){Promise<void>}

Starts an interactive operation to pick a layer to exclude from the slice analysis.

If the user clicks on the ground, the excludeGroundSurface property is set to true. Otherwise, the clicked layer is added to the excludedLayers.

This method can only be called when the analysis has a valid shape. Otherwise, an error is thrown. Calling this method sets interactive and active to true.

Parameters
optional

An object specifying additional options.

Specification
optional

Abort signal which can be used to cancel the operation.

Returns
Type Description
Promise<void> A promise which resolves when the operation is completed successfully or rejected if it is canceled.

place

Method
place(options){Promise<SlicePlacementResult>}

Starts the interactive placement of a slice plane.

If the analysis does not have a shape yet, the method allows placing the slice plane interactively in the view. If the analysis already has a shape, clicking in the view will replace the existing shape with a new one.

The placement operation will finish when the user presses the escape key. To stop the placing programmatically, pass an abort signal as an argument when calling the method.

Calling this method sets interactive and active to true.

Parameters
optional

An object specifying additional options.

Specification
optional

Abort signal which can be used to cancel the operation.

Returns
Type Description
Promise<SlicePlacementResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled.
Example
const abortController = new AbortController();

try {
  await analysisView.place({ signal: abortController.signal });
} catch (error) {
  if (error.name === "AbortError") {
    console.log("Placement operation was cancelled.");
  }
}

// cancel the placement operation at some later point
abortController.abort();

Type Definitions

SlicePlacementResult

Type Definition
SlicePlacementResult

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.