import ElevationProfileViewModel from "@arcgis/core/widgets/ElevationProfile/ElevationProfileViewModel.js";const ElevationProfileViewModel = await $arcgis.import("@arcgis/core/widgets/ElevationProfile/ElevationProfileViewModel.js");- Inheritance:
- ElevationProfileViewModel→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.18
Provides the logic for the ElevationProfile widget.
How distance values are computed depends on the map's spatial reference:
- In geographic coordinate systems (GCS) and in Web Mercator, distances are computed geodetically.
- In projected coordinate systems (PCS), apart from Web Mercator, distances are computed in a Euclidean manner (in their respective PCS).
- See also
ElevationProfile widget - Deprecated since 5.0. Use the Elevation Profile component instead.
ElevationProfileLineGround - Deprecated since 5.0. Use ElevationProfileLineGround instead.
ElevationProfileLineInput - Deprecated since 5.0. Use ElevationProfileLineInput instead.
ElevationProfileLineQuery - Deprecated since 5.0. Use ElevationProfileLineQuery instead.
ElevationProfileLineView - Deprecated since 5.0. Use ElevationProfileLineScene instead.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
declaredClass readonly inherited | ||
effectiveUnits readonly | | |
| | ||
| | ||
| | ||
| | ||
progress readonly | | |
state readonly | | |
| | ||
| | ||
| | ||
| |
effectiveUnits
- Type
- EffectiveUnits
Units which have been selected according to the magnitude of the elevations and distances that are to be displayed in the widget, according to the selected unit or unit system.
highlightEnabled
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Whether the graphic used as ElevationProfile.input is highlighted. The highlight color and opacity can be changed in SceneView.highlights.
- Default value
- true
input
The input path along which elevation will be queried in order to generate an elevation profile.
Typically not set when creating the widget. In this case the widget starts empty,
and waits for the user to either draw a new profile or generate a profile from selecting a line feature.
The result of this action populates input.
input can be set when constructing the widget, or set or changed at runtime.
The input graphic must contain a geometry of type Polyline.
Symbol and attributes of the input graphic are ignored.
profiles
Collection of elevation profile lines which are to be generated and displayed in the widget's chart. See the different profile line types for details on usage and behavior.
Once an elevation profile is generated, each line will contain the raw data used to generate the chart and statistics. The order of the profiles within the collection determines the drawing order on the chart.
In a MapView ElevationProfileLineView is not supported.
progress
- Type
- number
The progress, between 0 and 1 of generating all the configured elevation profiles.
state
The current state of the view model that can be used for rendering the UI of the widget.
| Value | Description |
|---|---|
| disabled | widget is being created |
| ready | widget is ready. No path configured and no interactive operation ongoing. |
| creating | user is creating a new input path. |
| created | input path is configured but no interactive operation is ongoing. |
| selecting | user is selecting an existing input path. |
| selected | user selected an existing input path. |
- Default value
- "disabled"
uniformChartScaling
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Whether the chart should use a uniform scale for the X and Y axes. When a uniform scale is applied, the X axis will display the same distance units per pixel as the elevation units per pixel displayed in the Y axis.
- Default value
- false
unit
- Type
- SystemOrLengthUnit
Unit system (imperial, metric) or specific unit used for displaying the elevation and distance values.
unitOptions
- Type
- SystemOrLengthUnit[]
List of available units and unit systems (imperial, metric) for displaying the elevation and distance values.
Methods
cancel
- Signature
-
cancel (): void
Stops a creation/selection operation and restores the previously configured input path.
- Returns
- void
clear
- Signature
-
clear (): void
Clears the existing profile and stops any interaction.
- Returns
- void
start
- Signature
-
start (options?: InteractionStartOptions): void
If mode is "sketch" (the default), switches to the "creating" state in which the user can draw a new line. If the mode is "select", switches to the "selecting" state and lets the user click on the view to select an existing line.
If any line is present, when the first point is drawn or an existing line is selected, the previous input is discarded.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| options | Start options. | |
- Returns
- void
stop
- Signature
-
stop (): void
Stops a creation/selection operation. If the current operation is a "sketch" and the input has at least two committed points (not being dragged), the input is kept. Otherwise the input is set to null.
- Returns
- void