Created
July 30, 2019 13:45
-
-
Save RalucaNicola/9c96c1956af31a6409de6f3582b27819 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const view = require("esri/views/View").views.getItemAt(0); | |
(function() { | |
const p = view.camera.position; | |
if (p.spatialReference.isWebMercator || p.spatialReference.isWGS84) { | |
console.log(` | |
{ | |
position: [ | |
${p.longitude.toFixed(8)}, | |
${p.latitude.toFixed(8)}, | |
${p.z.toFixed(5)} | |
], | |
heading: ${view.camera.heading.toFixed(2)}, | |
tilt: ${view.camera.tilt.toFixed(2)} | |
}`); | |
} | |
else { | |
console.log(` | |
{ | |
position: { | |
x: ${p.x.toFixed(5)}, | |
y: ${p.y.toFixed(5)}, | |
z: ${p.z.toFixed(3)}, | |
spatialReference: ${p.spatialReference.wkid} | |
}, | |
heading: ${view.camera.heading.toFixed(2)}, | |
tilt: ${view.camera.tilt.toFixed(2)} | |
}`); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment