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 being hovered in the chart, in the view's spatial reference, computed from the hoveredPosition property. | ElevationProfileAnalysisView2D | ||
Property to track the position, in [0, 1], that is being hovered in the elevation profile chart. | 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
analysis ElevationProfileAnalysisreadonly
-
The elevation profile analysis associated with the analysis view.
-
effectiveDisplayUnits
effectiveDisplayUnits 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
error 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 being hovered in the chart, in the view's spatial reference, computed from the hoveredPosition property. There is one point for each profile line. When a profile line is not available or no sample exists for the hovered position, the point is
undefined
.
-
Property to track the position, in [0, 1], that is being hovered in the elevation profile chart. Can be used to display the corresponding location in the view, see hoveredPoints.
- Default Value:null
-
progress
progress 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
results 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
statistics Statistics |null |undefinedreadonly
-
Combined statistics of all the computed profile lines.
-
type
type Stringreadonly
-
The analysis view type.
For ElevationProfileAnalysisView2D the type is always "elevation-profile-view-2d".
-
updating
updating 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
pickFeature(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
place(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."); } }