{
int numPoints = 20;//Or any number of points you want to interpolate
// use a specific elevation surface
var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
// use the default ground elevation surface
MapPoint startPt = MapPointBuilderEx.CreateMapPoint(-130, 20, SpatialReferences.WGS84);
MapPoint endPt = MapPointBuilderEx.CreateMapPoint(-100, 50, SpatialReferences.WGS84);
var result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(startPt, endPt, numPoints);
if (result.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = result.Polyline;
// process the polylineZ
}
// use a specific elevation surface
result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(startPt, endPt, numPoints, eleLayer);
if (result.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = result.Polyline;
// process the polylineZ
}
}