Skip to content
import ElevationProfileLine from "@arcgis/core/widgets/ElevationProfile/ElevationProfileLine.js";
Inheritance:
ElevationProfileLineAccessor
Subclasses:
ElevationProfileLineGround, ElevationProfileLineInput, ElevationProfileLineQuery, ElevationProfileLineView
Since
ArcGIS Maps SDK for JavaScript 4.18

Common interface for all the elevation profile lines.

See also

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.

color

autocast Property
Type
Color

Color of the line on the chart and the hovered points in the view.

Default value
"#000000"

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

hoveredPoint

readonly Property
Type
Point | null | undefined

Point being hovered in the chart, in the view's spatial reference.

id

Property
Type
string

Unique identifier for the profile line.

progress

readonly Property
Type
number

How far along the generation of this profile is. 0 means nothing was loaded and 1 means loading is complete.

samples

readonly Property
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

readonly Property
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

Property
Type
string | null | undefined

Title of the line, to be displayed in the chart tooltip and in the chart legend.

type

readonly Property
Type
ElevationProfileLineType

The line type.

viewVisualizationEnabled

Property
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

Property
Type
boolean

Whether the line should be computed and shown in the chart.

Default value
true

Methods

MethodSignatureClass
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

inherited Method
Signature
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Emits an event on the instance. This method should only be used when creating subclasses of this class.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

event
this["@eventTypes"][Type]

The event payload.

Returns
boolean

true if a listener was notified

hasEventListener

inherited Method
Signature
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Indicates whether there is an event listener on the instance that matches the provided event name.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

Returns
boolean

Returns true if the class supports the input event.

on

inherited Method
Signature
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters
ParameterTypeDescriptionRequired
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).

PropertyTypeDescription
removeFunctionWhen 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);
});