Hi,
I'm trying to get camera position in a continuous manner(latitude, longitude, altitude, pitch, roll etc), e.g. if I try to set camera position for a object on map, I move it continuously until desired camera location is set.
I used LEFT_DOWN screen space event handler to capture camera details. Is there any better way to do this?? Sometimes even if I click I don't get new camera values, so not sure if that is changed from last LEFT DOWN EVENT.
I'm trying to achieve higher precision.
Here is sample code:
handler2 = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler2.setInputAction(function(movement) {
//console.log("Left down");
var cartesian = viewer.camera.pickEllipsoid(movement.position, ellipsoid);
var ray = viewer.camera.getPickRay(movement.position);
var position = viewer.scene.globe.pick(ray, viewer.scene);
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
var cartographicAlt = ellipsoid.cartesianToCartographic(viewer.scene.camera.positionWC).height;
longitudeString = Cesium.Math.toDegrees(ellipsoid.cartesianToCartographic(viewer.scene.camera.positionWC).longitude);
latitudeString = Cesium.Math.toDegrees(ellipsoid.cartesianToCartographic(viewer.scene.camera.positionWC).latitude);
altitudeString = cartographicAlt;
pitchString = Cesium.Math.toDegrees(viewer.scene.camera.pitch);
rollString = Cesium.Math.toDegrees(viewer.scene.camera.roll);
headingString = Cesium.Math.toDegrees(viewer.scene.camera.heading);
tiltString = pitchString + 90;
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);