//현재의 카메라 위치를 세슘에서 가져오기
var cartographic = viewer.camera.positionCartographic; //현재 카메라 위치를 가져옴 : 라디안
var saveCameraX = Cesium.Math.toDegrees(cartographic.longitude).toFixed(10); //라디안을 도(경위도) 단위로 변경
var saveCameraY = Cesium.Math.toDegrees(cartographic.latitude).toFixed(10); //라디안을 도(경위도) 단위로 변경
var saveCameraZ = cartographic.height.toFixed(3);
console.log('cartographic.longitude:',cartographic.longitude);
console.log('cartographic.latitude:',cartographic.latitude);
console.log('cartographic.height:',cartographic.height);
console.log('longitude:',saveCameraX);
console.log('latitude:',saveCameraY);
console.log('height:',saveCameraZ);
Cesium 지도에서 화면 가운데 좌표 알아내기 (높이는 측정되지 않았음)
//화면 가운데 좌표 알아내기
var cartographic = new Cesium.Rectangle(0, 0, 0, 0);
viewer.camera.computeViewRectangle(Cesium.Ellipsoid.WGS84, cartographic);
var west = Number(Cesium.Math.toDegrees(cartographic.west));
var south = Number(Cesium.Math.toDegrees(cartographic.south));
var east = Number(Cesium.Math.toDegrees(cartographic.east));
var north = Number(Cesium.Math.toDegrees(cartographic.north));
console.log('west:',Cesium.Math.toDegrees(cartographic.west));
console.log('south:',Cesium.Math.toDegrees(cartographic.south));
console.log('east:',Cesium.Math.toDegrees(cartographic.east));
console.log('north:',Cesium.Math.toDegrees(cartographic.north));
console.log('west-east 중점:',((east-west)/2+west));
console.log('south-north 중점:',((north-south)/2+south));
console.log('고도:',cartographic.height);