Hi all,
I am using worldelevation3D service to display X-Y-Z coordinates, but X and Y i want to show in WKID: 32638,
SpatialReference for map i have isGCSWGS1984. To get coordinates i use this code still get different WKID coordinates:
let beforeLandslideUrl =
"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
const sr1 = new SpatialReference({ wkid: 32638 });
let beforeLandslideLayer = new ElevationLayer({
url: beforeLandslideUrl,
spatialReference: sr1
});
view.on("click", function(event) {
var xyztext = document.getElementById("xyzcheckbox");
if(xyztext.checked == true){
// Query both elevation layers for the elevation at the clicked map position
var position = event.mapPoint;
var queryBeforeLandslide = beforeLandslideLayer.queryElevation(position);
// When both query promises resolve execute the following code
promiseUtils
.eachAlways([queryBeforeLandslide])
.then(function(results) {
var posBeforeLandslide = results[0].value.geometry;
// Clear graphics from previous result (if applicable)
//view.graphics.removeAll();
//alert("ზღვის დონიდან: " + posBeforeLandslide.z +", " + "x: " + posBeforeLandslide.x + ", " + "y: " + posBeforeLandslide.y)
// document.getElementById('xyzspan').innerHTML = "X: " + posBeforeLandslide.x.toFixed(2)+ "; " + "Y: " + posBeforeLandslide.y.toFixed(2)+ "; " + "Z: " + posBeforeLandslide.z.toFixed(2);
document.getElementById('xspan').innerHTML = "X: " + posBeforeLandslide.x.toFixed(2);
document.getElementById('yspan').innerHTML = "Y: " + posBeforeLandslide.y.toFixed(2);
document.getElementById('zspan').innerHTML = "Z: " + posBeforeLandslide.z.toFixed(2);
})
}
else
{
//view.graphics.removeAll();
}
});