ElevationProfileViewModel

AMD: require(["esri/widgets/ElevationProfile/ElevationProfileViewModel"], (ElevationProfileViewModel) => { /* code goes here */ });
ESM: import ElevationProfileViewModel from "@arcgis/core/widgets/ElevationProfile/ElevationProfileViewModel.js";
Class: esri/widgets/ElevationProfile/ElevationProfileViewModel
Inheritance: ElevationProfileViewModel Accessor
Since: ArcGIS Maps SDK for JavaScript 4.18

Provides the logic for the ElevationProfile widget.

See also

Constructors

ElevationProfileViewModel

Constructor
new ElevationProfileViewModel(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The name of the class.

Accessor

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.

ElevationProfileViewModel

Threshold (in meters) which determines the method for computing and displaying distances in non-Web Mercator projected coordinate systems (PCS).

ElevationProfileViewModel

Whether the graphic used as input is highlighted.

ElevationProfileViewModel

The position, in the range [0, 1], being hovered in the graph.

ElevationProfileViewModel

The input path along which elevation will be queried in order to generate an elevation profile.

ElevationProfileViewModel

Collection of elevation profile lines which are to be generated and displayed in the widget's chart.

ElevationProfileViewModel

The progress, between 0 and 1 of generating all the configured elevation profiles.

ElevationProfileViewModel

The current state of the view model that can be used for rendering the UI of the widget.

ElevationProfileViewModel

Whether the chart should use a uniform scale for the X and Y axes.

ElevationProfileViewModel

Unit system (imperial, metric) or specific unit used for displaying the elevation and distance values.

ElevationProfileViewModel

List of available units and unit systems (imperial, metric) for displaying the elevation and distance values.

ElevationProfileViewModel

A reference to the View.

ElevationProfileViewModel

Property Details

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

effectiveUnits

Property
effectiveUnits EffectiveUnitsreadonly

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.

geodesicDistanceThreshold

Property
geodesicDistanceThreshold Number
Deprecated since version 4.29.

Threshold (in meters) which determines the method for computing and displaying distances in non-Web Mercator projected coordinate systems (PCS).

  • Below this threshold, distances are computed in a Euclidean manner (in their respective PCS).
  • Above this threshold, distances are computed geodetically.

If the threshold is omitted (default), distances are always computed in a Euclidean manner.

This property is ignored if the map’s spatial reference is a geographic coordinate system (GCS) or Web Mercator. Meaning that distances are always computed geodetically.

Default Value:null

highlightEnabled

Property
highlightEnabled Boolean
Since: ArcGIS Maps SDK for JavaScript 4.20 ElevationProfileViewModel since 4.18, highlightEnabled added at 4.20.

Whether the graphic used as input is highlighted. The highlight color and opacity can be changed in highlightOptions.

Default Value:true

hoveredChartPosition

Property
hoveredChartPosition Number

The position, in the range [0, 1], being hovered in the graph. We'll use this to determine which samples are being hovered and mark their position in the view.

input

Property
input Graphicautocast

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.

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

Property
progress Numberreadonly

The progress, between 0 and 1 of generating all the configured elevation profiles.

state

Property
state Stringreadonly

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.

Possible Values:"disabled" |"ready" |"creating" |"created" |"selecting" |"selected"

Default Value:disabled

uniformChartScaling

Property
uniformChartScaling Boolean
Since: ArcGIS Maps SDK for JavaScript 4.20 ElevationProfileViewModel since 4.18, uniformChartScaling added at 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.

unit

Property
unit SystemOrLengthUnit

Unit system (imperial, metric) or specific unit used for displaying the elevation and distance values.

unitOptions

Property
unitOptions SystemOrLengthUnit[]

List of available units and unit systems (imperial, metric) for displaying the elevation and distance values.

view

Property
view SceneView |MapView

A reference to the View.

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor

Stops a creation/selection operation and restores the previously configured input path.

ElevationProfileViewModel

Clears the existing profile and stops any interaction.

ElevationProfileViewModel

Returns true if a named group of handles exist.

Accessor

Removes a group of handles owned by the object.

Accessor

If mode is "sketch" (the default), switches to the "creating" state in which the user can draw a new line.

ElevationProfileViewModel

Stops a creation/selection operation.

ElevationProfileViewModel

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

cancel

Method
cancel()

Stops a creation/selection operation and restores the previously configured input path.

clear

Method
clear()

Clears the existing profile and stops any interaction.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

start

Method
start(options)

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
options Object
optional

Start options.

Specification
mode String
optional
Default Value: "sketch"

The mode that the widget will start with. In "sketch" mode the user can draw a new line and in "select" mode the user can click on the view to select an existing line.

Possible Values:"sketch"|"select"

stop

Method
stop()

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.

Type Definitions

EffectiveUnits

Type Definition
EffectiveUnits

The 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.

Properties
distance LengthUnit

Units used for displaying distance or length values.

elevation LengthUnit

Units used for displaying elevation values.

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