import ElevationProfileAnalysisView2D from "@arcgis/core/views/2d/analysis/ElevationProfileAnalysisView2D.js";
const ElevationProfileAnalysisView2D = await $arcgis.import("@arcgis/core/views/2d/analysis/ElevationProfileAnalysisView2D.js");
@arcgis/core/views/2d/analysis/ElevationProfileAnalysisView2D
Represents the analysis view of an ElevationProfileAnalysis after it has been added to MapView.analyses.
The ElevationProfileAnalysisView2D is responsible for rendering an ElevationProfileAnalysis using custom visualizations. The results property contains the computed elevation profile results.
The view for an analysis can be retrieved using MapView.whenAnalysisView similar to how layer views are retrieved for layers using MapView.whenLayerView.
// Retrieve analysis view for analysis
const analysis = new ElevationProfileAnalysis();
view.analyses.add(analysis); // Add to the view
const analysisView = await view.whenAnalysisView(analysis);
Property Overview
| Name | Type | Summary | Class |
|---|---|---|---|
The elevation profile analysis associated with the analysis view. | ElevationProfileAnalysisView2D | ||
Units used for all the results and statistics of the elevation profile analysis. | ElevationProfileAnalysisView2D | ||
Error encountered while calculating the analysis result. | ElevationProfileAnalysisView2D | ||
Points in the view that are computed from the hoveredPosition property (in the view's spatial reference). | ElevationProfileAnalysisView2D | ||
Property that indicates a relative position along a result's profile line, in [0, 1]. | ElevationProfileAnalysisView2D | ||
Enables interactivity for the analysis. | ElevationProfileAnalysisView2D | ||
Combined progress (0 to 1) of generating all configured profiles. | ElevationProfileAnalysisView2D | ||
Results of the elevation profile analysis. | ElevationProfileAnalysisView2D | ||
Combined statistics of all the computed profile lines. | ElevationProfileAnalysisView2D | ||
The analysis view type. | ElevationProfileAnalysisView2D | ||
Whether the analysis is currently being updated. | ElevationProfileAnalysisView2D | ||
When | ElevationProfileAnalysisView2D |
Property Details
-
analysis
Propertyanalysis ElevationProfileAnalysisreadonly -
The elevation profile analysis associated with the analysis view.
-
effectiveDisplayUnits
PropertyeffectiveDisplayUnits ElevationProfileEffectiveDisplayUnitsreadonly -
Units used for all the results and statistics of the elevation profile analysis.
If not specified by user with ElevationProfileAnalysis.displayUnits, the units are chosen automatically based on the magnitude of the results.
-
error
Propertyerror ElevationProfileError |null |undefinedreadonly -
Error encountered while calculating the analysis result. The error has well defined names that can be used to provide specific error feedback to the user. See ElevationProfileError for the list of possible error names.
-
Points in the view that are computed from the hoveredPosition property (in the view's spatial reference). There is one point for each profile line. When a result of a profile line is not available or no sample exists for the hovered position, the point is
undefined.Whenever the hoveredPosition property has a value, the points are calculated, and by default, rendered in the view. The points in the view can be hidden using the viewOptions.hoveredPointVisible setting on any of the profile lines.
-
Property that indicates a relative position along a result's profile line, in [0, 1]. This can be used to track a hovered position in an elevation profile chart and display the corresponding points in the view using hoveredPoints.
- Default Value:null
-
progress
Propertyprogress Numberreadonly -
Combined progress (0 to 1) of generating all configured profiles.
ExamplereactiveUtils.watch( () => analysisView.progress, (progress) => { // Watch the progress and update the chart or UI when needed });
-
results
Propertyresults ElevationProfileResult[]readonly -
Results of the elevation profile analysis. Result objects are created immediately but they are gradually updated as the analysis is computed.
Watch progress to see the state of the calculation.
-
statistics
Propertystatistics Statistics |null |undefinedreadonly -
Combined statistics of all the computed profile lines.
-
type
Propertytype Stringreadonly -
The analysis view type.
For ElevationProfileAnalysisView2D the type is always "elevation-profile-view-2d".
-
updating
Propertyupdating Booleanreadonly -
Whether the analysis is currently being updated.
Method Overview
| Name | Return Type | Summary | Class |
|---|---|---|---|
Promise<ElevationProfilePickResult> | Starts an interactive operation to pick a line feature in the view to use as the input for the elevation profile analysis. | ElevationProfileAnalysisView2D | |
Promise<ElevationProfilePlacementResult> | Starts the interactive placement of a new input line for the elevation profile analysis. | ElevationProfileAnalysisView2D |
Method Details
-
pickFeature
MethodpickFeature(options){Promise<ElevationProfilePickResult>} -
Starts an interactive operation to pick a line feature in the view to use as the input for the elevation profile analysis.
The operation will finish when the user presses the escape key. To stop the operation programmatically, pass an abort signal as an argument when calling the method.
ParametersReturnsType Description Promise<ElevationProfilePickResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled. Example// Use AbortController to cancel the picking operation at some later point by calling abortController.abort() const abortController = new AbortController(); try { await analysisView.pickFeature({ signal: abortController.signal }); } catch (error) { if (error.name === "AbortError") { console.log("Picking operation was cancelled."); } }
-
place
Methodplace(options){Promise<ElevationProfilePlacementResult>} -
Starts the interactive placement of a new input line for the elevation profile analysis.
If the analysis does not have a geometry yet, the method allows drawing it interactively in the view. Otherwise, clicking in the view will remove the previous input line and start a new placement operation.
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 to
true.ParametersReturnsType Description Promise<ElevationProfilePlacementResult> A promise which resolves when the operation is completed successfully or rejected if it is canceled. Example// Use AbortController to cancel the placement operation at some later point by calling abortController.abort() const abortController = new AbortController(); try { await analysisView.place({ signal: abortController.signal }); } catch (error) { if (error.name === "AbortError") { console.log("Placement operation was cancelled."); } }