ElevationProfileViewModel

require(["esri/widgets/ElevationProfile/ElevationProfileViewModel"], function(ElevationProfileViewModel) { /* code goes here */ });
Class: esri/widgets/ElevationProfile/ElevationProfileViewModel
Inheritance: ElevationProfileViewModel Accessor
Since: ArcGIS API for JavaScript 4.18
beta

Provides the logic for the ElevationProfile widget.

See also:

Constructors

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.
NameTypeSummaryClass
String

The name of the class.

more details
more detailsAccessor
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.

more details
more detailsElevationProfileViewModel
Number

When the spatial reference is projected (other than web mercator) and the path is shorter than this threshold, distances will be computed planimetrically.

more details
more detailsElevationProfileViewModel
Number

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

more details
more detailsElevationProfileViewModel
Graphic

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

more details
more detailsElevationProfileViewModel
Collection<(ElevationProfileLineGround|ElevationProfileLineInput|ElevationProfileLineQuery|ElevationProfileLineView)>

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

more details
more detailsElevationProfileViewModel
Number

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

more details
more detailsElevationProfileViewModel
String

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

more details
more detailsElevationProfileViewModel
SystemOrLengthUnit

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

more details
more detailsElevationProfileViewModel
SystemOrLengthUnit[]

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

more details
more detailsElevationProfileViewModel
SceneView|MapView

A reference to the View.

more details
more detailsElevationProfileViewModel

Property Details

declaredClass Stringreadonly inherited

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

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 Number

When the spatial reference is projected (other than web mercator) and the path is shorter than this threshold, distances will be computed planimetrically. Otherwise distances will be computed geodetically.

Default Value:100000
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.

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 ground is the only supported profile line type.

progress Numberreadonly

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

state Stringreadonly

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

ValueDescription
disabledwidget is being created
readywidget is ready. No path configured and no interactive operation ongoing.
creatinguser is creating a new input path.
createdinput path is configured but no interactive operation is ongoing.
selectinguser is selecting an existing input path.
selecteduser selected an existing input path.

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

Default Value:disabled

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

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

A reference to the View.

Method Overview

NameReturn TypeSummaryClass

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

more details
more detailsElevationProfileViewModel

Clears the existing profile and stops any interaction.

more details
more detailsElevationProfileViewModel

The elevation profile lines which are visible.

more details
more detailsElevationProfileViewModel

How many elevation units we should show per pixel (U[d]/px).

more details
more detailsElevationProfileViewModel

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

more details
more detailsElevationProfileViewModel

Stops a creation/selection operation.

more details
more detailsElevationProfileViewModel

Method Details

cancel()

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

clear()

Clears the existing profile and stops any interaction.

get()inner

The elevation profile lines which are visible.

get()inner

How many elevation units we should show per pixel (U[d]/px). We use this information to scale the chart's Y axis in order to hide irrelevant imprecisions in elevation sampled from the view.

start(options)

If mode is "sketch" (the default), switches to the "creating" state in which the user can draw a new path. If the mode is "select", switches to the "selecting" state and lets the user click on the view to select an existing path.

If any path is present, when the first point is drawn or an existing path is selected, the previous input is discarded.

Parameters:
options Object
optional

Start options.

Specification:
mode String
optional

The mode.

Possible Values:"sketch"|"select"

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), we'll keep it. Otherwise we'll set the input to null.

Type Definitions

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.

API Reference search results

NameTypeModule
Loading...