AnsweredAssumed Answered

Able to click view for elevation in 4.2?

Question asked by davidchrest on Jan 24, 2017
Latest reply on Jan 25, 2017 by davidchrest

Is there a way to click the SceneView to capture the elevation info of the the default "world-elevation" layer ? 

Getting coordinates can be done fairly easily (see code below) but can the same kind of thing be done to get an elevation reading when the user clicks on the SceneView? The ImageServiceIdentifyTask seems to be only for an added custom ElevationLayer and the documentation is a bit confusing.

 

//Click on View for coordinates to display
view.on("click", function (event) {
// Get the coordinates of the click on the view
var lat = Math.round(event.mapPoint.latitude * 1000) / 1000;
var lon = Math.round(event.mapPoint.longitude * 1000) / 1000;
setTimeout(function () {
dom.byId("info").innerHTML = lat + ", " + lon;
}, 50);
});

Outcomes