Skip to content
import ElevationProfileLineQuery from "@arcgis/core/analysis/ElevationProfile/ElevationProfileLineQuery.js";
Inheritance:
ElevationProfileLineQueryElevationProfileLineAccessor
Since
ArcGIS Maps SDK for JavaScript 4.34

Represents a profile line that samples elevation from a custom elevation source, such as an ElevationLayer, or from an elevation layer in Ground.layers.

You can also provide a custom source object with a queryElevation method that matches the signature of ElevationLayer.queryElevation(), allowing for flexible elevation sampling strategies.

See also
Example
// Create an elevation profile analysis with a custom elevation layer as the source
const elevationLayer = new ElevationLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Elevation/MtBaldy_Elevation/ImageServer"
});
const analysis = new ElevationProfileAnalysis({
profiles: [{
type: "query",
source: elevationLayer
}]
});

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.

chartOptions

autocast inherited Property
Type
ElevationProfileLineChartOptions
Inherited from: ElevationProfileLine

Options for visualizing the profile line in a chart.

color

autocast Property
Type
Color

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

Default value
"#db334a"

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

enabled

inherited Property
Type
boolean
Inherited from: ElevationProfileLine

Indicates whether the line should be computed and displayed in the chart and view.

Default value
true

id

inherited Property
Type
string
Inherited from: ElevationProfileLine

Unique identifier for the profile line. This value is automatically generated unless specified.

source

Property
Type
ElevationQuerySource

Elevation source used to sample elevation when generating the profile, for example an ElevationLayer.

Examples
const elevationLayer = new ElevationLayer({
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/.../Elevation/ImageServer"
});
// Profile line with elevation layer source
const analysis1 = new ElevationProfileAnalysis({
profiles: [{
type: "query", // Autocasts as new ElevationProfileLineQuery(),
source: elevationLayer
}]
});
// Profile line with a source coming from an elevation
// layer with a specific sampling resolution
const analysis2 = new ElevationProfileAnalysis({
profiles: [{
type: "query",
source: {
queryElevation(geometry, options) {
return elevationLayer.queryElevation(geometry, { ...options, demResolution: 20 })
}
}
}]
});
// Profile line with a source that queries data
// on an elevation sampler
const sampler = await elevationLayer.createElevationSampler(extent);
const analysis3 = new ElevationProfileAnalysis({
profiles: [{
type: "query",
source: {
queryElevation: async (geometry: Multipoint) => {
return {
geometry: await sampler.queryElevation(geometry),
noDataValue: sampler.noDataValue
};
}
}
}]
});

title

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

Title of the line, shown in the chart tooltip and legend.

type

readonly Property
Type
"query"

The line type.

viewOptions

autocast inherited Property
Type
ElevationProfileLineViewOptions
Inherited from: ElevationProfileLine

Options for visualizing the profile line in the view.

Methods

MethodSignatureClass
clone
inherited
clone(): this

clone

inherited Method
Signature
clone (): this
Inherited from: ClonableMixin

Creates a deep clone of this object. Any properties that store values by reference will be assigned copies of the referenced values on the cloned instance.

Returns
this

A deep clone of the class instance that invoked this method.

Type definitions

ElevationQuerySource

Type definition

queryElevation

Method
Signature
queryElevation (geometry: Multipoint, options?: ElevationQueryOptions): Promise<ElevationQueryResult<Multipoint>>

Function used to query elevation values for a Multipoint geometry. It returns a promise that resolves with an ElevationQueryResult.

Parameters
ParameterTypeDescriptionRequired
geometry

The geometry to use for sampling elevation data.

options

Additional query options.

Returns
Promise<ElevationQueryResult<Multipoint>>

Resolves to an object with the sampled geometry, resolution information, and no data value.