import ElevationProfileLineGround from "@arcgis/core/widgets/ElevationProfile/ElevationProfileLineGround.js";const ElevationProfileLineGround = await $arcgis.import("@arcgis/core/widgets/ElevationProfile/ElevationProfileLineGround.js");- Inheritance:
- ElevationProfileLineGround→
ElevationProfileLine→ Accessor
- Since
- ArcGIS Maps SDK for JavaScript 4.18
Profile line which samples elevation from the Ground of the Map currently set in the View.
Whenever layers are added or removed from the Ground or their visibility changes, the profile line will be updated.

- See also
ElevationProfile widget - Deprecated since 5.0. Use the Elevation Profile component instead.
ElevationProfileViewModel - Deprecated since 5.0. Use ElevationProfileAnalysis instead.
ElevationProfileLineInput - Deprecated since 5.0. Use ElevationProfileLineInput from ElevationProfileAnalysis instead.
ElevationProfileLineQuery - Deprecated since 5.0. Use ElevationProfileLineQuery from ElevationProfileAnalysis instead.
ElevationProfileLineView - Deprecated since 5.0. Use ElevationProfileLineScene from ElevationProfileAnalysis instead.
Example
const elevationProfile = new ElevationProfile({ view: view, profiles: [{ type: "ground", // autocasts as new ElevationProfileLineGround(), color: "red", // display this profile in red title: "World elevation" // with a custom label }]});Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
declaredClass readonly inherited | ||
hoveredPoint readonly inherited | ||
id inherited | ||
progress readonly inherited | ||
samples readonly inherited | ||
statistics readonly inherited | ||
title inherited | ||
type readonly | "ground" | |
| | ||
visible inherited |
hoveredPoint
Point being hovered in the chart, in the view's spatial reference.
id
- Type
- string
Unique identifier for the profile line.
progress
- Type
- number
How far along the generation of this profile is. 0 means nothing was loaded and 1 means loading is complete.
samples
- Type
- ElevationProfileSample[] | null | undefined
List of samples that make up the elevation profile. It can be passed to a graphing library in order to display the profile in 2D.
statistics
- Type
- ElevationProfileStatistics | null | undefined
Statistics about the generated elevation profile, if available.
For slope computations, profiles are sampled at a minimum distance of 10 meters (32.8 feet). Higher resolution profiles are downsampled to a 10-meter (32.8-foot) sampling distance before calculating the slope.
title
Title of the line, to be displayed in the chart tooltip and in the chart legend.
viewVisualizationEnabled
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Whether a line visualization representing elevationSamples should be added to the SceneView. This property doesn't apply to MapView.
- Default value
- true
visible
- Type
- boolean
Whether the line should be computed and shown in the chart.
- Default value
- true
Methods
| Method | Signature | Class |
|---|---|---|
emit inherited | emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean | |
hasEventListener inherited | hasEventListener<Type extends EventNames<this>>(type: Type): boolean | |
on inherited | on<Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle |
emit
- Signature
-
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
- Type parameters
- <Type extends EventNames<this>>
Emits an event on the instance. This method should only be used when creating subclasses of this class.
hasEventListener
- Signature
-
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
- Type parameters
- <Type extends EventNames<this>>
Indicates whether there is an event listener on the instance that matches the provided event name.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | The name of the event. | |
- Returns
- boolean
Returns true if the class supports the input event.
on
- Signature
-
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
- Type parameters
- <Type extends EventNames<this>>
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | An event or an array of events to listen for. | |
| listener | EventedCallback<this["@eventTypes"][Type]> | The function to call when the event fires. | |
- Returns
- ResourceHandle
Returns an event handler with a
remove()method that should be called to stop listening for the event(s).Property Type Description remove Function When called, removes the listener from the event.
Example
view.on("click", function(event){ // event is the event handle returned after the event fires. console.log(event.mapPoint);});