import "@arcgis/map-components/components/arcgis-elevation-profile";The Elevation Profile component is used to generate and display an elevation profile from an input line graphic.
See also
Demo
Properties
| Property | Attribute | Type |
|---|---|---|
autoDestroyDisabled | auto-destroy-disabled | boolean |
effectiveUnitsreadonly | | EffectiveUnits |
hideChart | hide-chart | boolean |
hideClearButton | hide-clear-button | boolean |
hideLegend | hide-legend | boolean |
hideSelectButton | hide-select-button | boolean |
hideSettingsButton | hide-settings-button | boolean |
hideSketchButton | hide-sketch-button | boolean |
hideUniformChartScalingToggle | hide-uniform-chart-scaling-toggle | boolean |
hideUnitSelector | hide-unit-selector | boolean |
highlightEnabled | highlight-enabled | boolean |
hoveredChartPosition | hovered-chart-position | number |
icon | icon | string |
input | | Graphic |
label | label | string |
positiondeprecated | position | "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing" |
profiles | | Collection<ElevationProfileElevationProfileLineGround | ElevationProfileElevationProfileLineInput | ElevationProfileElevationProfileLineQuery | ElevationProfileLineView> |
progressreadonly | | number |
referenceElement | reference-element | HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string |
statereadonlyreflected | state | "created" | "creating" | "disabled" | "ready" | "selected" | "selecting" |
uniformChartScaling | uniform-chart-scaling | boolean |
unit | unit | "centimeters" | "decimeters" | "feet" | "imperial" | "inches" | "kilometers" | "meters" | "metric" | "miles" | "millimeters" | "nautical-miles" | "us-feet" | "yards" |
unitOptions | | Array<"meters" | "metric" | "centimeters" | "decimeters" | "feet" | "inches" | "kilometers" | "millimeters" | "nautical-miles" | "us-feet" | "yards" | "miles" | "imperial"> |
view | | MapView | SceneView |
autoDestroyDisabled
autoDestroyDisabled: booleanIf true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
effectiveUnits
effectiveUnits: EffectiveUnitsUnits which have been selected according to the magnitude of the elevations and distances that are to be displayed in the component, according to the selected unit or unit system.
hideSettingsButton
hideSettingsButton: boolean- Attribute
- hide-settings-button
- Default value
- false
hideUniformChartScalingToggle
hideUniformChartScalingToggle: boolean- Attribute
- hide-uniform-chart-scaling-toggle
- Default value
- false
highlightEnabled
highlightEnabled: booleanWhether the graphic used as input is highlighted.
- Attribute
- highlight-enabled
- Default value
- true
hoveredChartPosition
hoveredChartPosition: numberThe position, in the range [0, 1], being hovered in the graph.
- Attribute
- hovered-chart-position
icon
icon: stringIcon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).
- See also
- Attribute
- icon
- Default value
- "altitude"
input
input: GraphicThe input path along which elevation will be queried in order to generate an elevation profile.
- Default value
- null
position
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"slot instead.- Attribute
- position
profiles
profiles: Collection<ElevationProfileElevationProfileLineGround | ElevationProfileElevationProfileLineInput | ElevationProfileElevationProfileLineQuery | ElevationProfileLineView>Collection of elevation profile lines which are to be generated and displayed in the component's chart.
progress
progress: numberThe progress, between 0 and 1 of generating all the configured elevation profiles.
referenceElement
referenceElement: HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | stringBy assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
- Attribute
- reference-element
state
state: "created" | "creating" | "disabled" | "ready" | "selected" | "selecting"The component's state. The values mean the following:
disabled- component is being createdready- component is ready; no path configured and no interactive operation ongoingcreating- user is creating a new input pathcreated- input path is configured but no interactive operation is ongoingselecting- user is selecting an existing input pathselected- user selected an existing input path
- Attribute
- state
- Default value
- "disabled"
uniformChartScaling
uniformChartScaling: booleanWhether the chart should use a uniform scale for the X and Y axes.
- Attribute
- uniform-chart-scaling
- Default value
- false
unit
unit: "centimeters" | "decimeters" | "feet" | "imperial" | "inches" | "kilometers" | "meters" | "metric" | "miles" | "millimeters" | "nautical-miles" | "us-feet" | "yards"Unit system (imperial, metric) or specific unit used for displaying the elevation and distance values.
- Attribute
- unit
unitOptions
unitOptions: Array<"meters" | "metric" | "centimeters" | "decimeters" | "feet" | "inches" | "kilometers" | "millimeters" | "nautical-miles" | "us-feet" | "yards" | "miles" | "imperial">List of available units and unit systems (imperial, metric) for displaying the elevation and distance values.
view
The view associated with the component.
Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this
viewproperty which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the Elevation Profile component will be associated with a map or scene component rather than using theviewproperty.
Methods
| Method | Signature |
|---|---|
componentOnReady | componentOnReady(): Promise<void> |
destroy | destroy(): Promise<void> |
start | start(): Promise<void> |
stop | stop(): Promise<void> |
componentOnReady
componentOnReady(): Promise<void>Create a promise that resolves once component is fully loaded.
Example
const arcgisElevationProfile = document.querySelector("arcgis-elevation-profile");
document.body.append(arcgisElevationProfile);
await arcgisElevationProfile.componentOnReady();
console.log("arcgis-elevation-profile is ready to go!");- Returns
- Promise<void>
start
start(): Promise<void>Switches to the "creating" state in which the user can draw a new line.
- Returns
- Promise<void>
Events
| Event | Type |
|---|---|
arcgisPropertyChange | CustomEvent<{ name: "state" | "input" | "progress" | "effectiveUnits"; }> |
arcgisReady | CustomEvent<void> |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state" | "input" | "progress" | "effectiveUnits"; }>Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void>Emitted when the component associated with a map or scene view is ready to be interacted with.