This sample demonstrates how to use the Elevation Profile component to generate and display elevation profiles. The line used for the calculation can be interactively drawn as a single or multi-segment line.
The component’s profiles property is configured to show two elevation profiles: one for ground, one for the scene, which includes buildings.
document.querySelector("arcgis-elevation-profile").profiles = [ { type: "ground", // first profile line samples the ground elevation }, { type: "scene", // second profile samples the scene and shows building profiles },];For more configuration options see the Elevation Profile component in the Map components reference or the ElevationProfileAnalysis in the Core API reference.