Skip to content
import ElevationProfileLineInput from "@arcgis/core/widgets/ElevationProfile/ElevationProfileLineInput.js";
Inheritance:
ElevationProfileLineInputElevationProfileLineAccessor
Since
ArcGIS Maps SDK for JavaScript 4.18

Profile line which samples elevation from the geometry of the input Graphic itself, typically used on input lines with z values. If the input graphic is draped (elevation mode is "on-the-ground"), the elevation is sampled from the Ground, in case the scene has ground layers.

In 2D z values are not fetched from feature based layers. Therefore, a profile is generated for ElevationProfileLineInput only when the input feature is a client-side graphic with z values in a MapView.

elevation-profile-zline Profile generated from a line feature with z-values. The orange profile is created with a profile line of type input.

See also
Example
const elevationProfile = new ElevationProfile({
view: view,
profiles: [{
type: "input",
color: "orange"
}, {
type: "ground",
color: "lime"
}]
});

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

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 in the view.

Default value
"#00c8c8"

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

hoveredPoint

readonlyinherited Property
Type
Point | null | undefined
Inherited from: ElevationProfileLine

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

id

inherited Property
Type
string
Inherited from: ElevationProfileLine

Unique identifier for the profile line.

progress

readonlyinherited Property
Type
number
Inherited from: ElevationProfileLine

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

samples

readonlyinherited Property
Type
ElevationProfileSample[] | null | undefined
Inherited from: ElevationProfileLine

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

readonlyinherited Property
Type
ElevationProfileStatistics | null | undefined
Inherited from: ElevationProfileLine

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

inherited Property
Type
string | null | undefined
Inherited from: ElevationProfileLine

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

type

readonly Property
Type
"input"

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
false

visible

inherited Property
Type
boolean
Inherited from: ElevationProfileLine

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