ViewshedAnalysisView3D

AMD: require(["esri/views/3d/analysis/ViewshedAnalysisView3D"], (ViewshedAnalysisView3D) => { /* code goes here */ });
ESM: import ViewshedAnalysisView3D from "@arcgis/core/views/3d/analysis/ViewshedAnalysisView3D.js";
Class: esri/views/3d/analysis/ViewshedAnalysisView3D
Since: ArcGIS Maps SDK for JavaScript 4.30

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

The ViewshedAnalysisView3D is responsible for rendering a ViewshedAnalysis using custom visualizations.

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

The viewshed analysis view controls whether the viewsheds in their associated analysis can be created or edited interactively.

 // create new analysis and add it to the scene view
 const viewshedAnalysis = new ViewshedAnalysis();
 sceneView.analyses.add(viewshedAnalysis);
 // retrieve analysis view
 view.whenAnalysisView(viewshedAnalysis).then(viewshedAnalysisView => {
   // allow existing viewsheds in the analysis to be edited by selecting them
   viewshedAnalysisView.interactive = true;
   // start adding new viewsheds interactively
   viewshedAnalysisView.createLengthDimensions();
 });

Property Overview

Name Type Summary Class

The viewshed analysis object associated with the analysis view.

ViewshedAnalysisView3D

Set to true to enable interactivity for the associated ViewshedAnalysis.

ViewshedAnalysisView3D

The selected viewshed.

ViewshedAnalysisView3D

The analysis view type.

ViewshedAnalysisView3D

When true, the analysis is visualized in the view.

ViewshedAnalysisView3D

Property Details

analysis

Property
analysis ViewshedAnalysisreadonly

The viewshed analysis object associated with the analysis view.

interactive

Property
interactive Boolean

Set to true to enable interactivity for the associated ViewshedAnalysis. If the analysis has a valid shape defined, then manipulators will be shown which the user can click and drag in order to edit the analysis.

Default Value:false

selectedViewshed

Property
selectedViewshed Viewshed

The selected viewshed. If interactive is true, any viewshed in the analysis can be selected by clicking on it in the view. As long as interactive remains true, the properties of the selected dimension can be edited by interacting with manipulators in the view.

type

Property
type Stringreadonly

The analysis view type.

For ViewshedAnalysisView3D the type is always "viewshed-view-3d".

visible

Property
visible Boolean

When true, the analysis is visualized in the view.

Method Overview

Name Return Type Summary Class

Starts the interactive creation of new viewsheds and adds them to the analysis.

ViewshedAnalysisView3D

Method Details

createViewsheds

Method
createViewsheds(options){Promise}

Starts the interactive creation of new viewsheds and adds them to the analysis. The first click in the scene places the observer point and the second sets the viewshed's orientation.

The creation process will finish when the user double-clicks the mouse or presses the escape key. In order to otherwise stop the creation process, pass an abort signal as an argument when calling the method.

let abortController;
view.whenAnalysisView(viewshedAnalysis).then(viewshedAnalysisView => {
   // create a new controller
   abortController = new AbortController();
   // pass the controller as an argument to the interactive creation method
   viewshedAnalysisView.createViewsheds(abortController);
   // abort the controller to stop the creation process
   abortController.abort();
});

Calling this method sets interactive to true.

Note that when placing viewsheds interactively, the viewshed is created with a 2-meter vertical offset from the scene. This behavior is subject to change in a future release.

Parameters
options Object
optional

An object specifying additional options.

Specification
signal AbortSignal
optional

Abort signal which can be used to cancel creation.

Returns
Type Description
Promise A promise which resolves when creation is completed, or rejects if creation is cancelled.

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