// 捕获鼠标移动事件
handler.setInputAction(function onMouseMove(movement) {
// 获得当前的经纬度及高度
var ellipsoid = viewer.scene.globe.ellipsoid;
var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, ellipsoid);
if (cartesian) {
//将笛卡尔坐标转换为地理坐标
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
//将弧度转为度的十进制度表示
var longitudeString = Cesium.Math.toDegrees(cartographic.longitude);
var latitudeString = Cesium.Math.toDegrees(cartographic.latitude);
//获取相机高度
var height = Math.ceil(viewer.camera.positionCartographic.height);
console.log('(' + longitudeString + ', ' + latitudeString + "," + height + ')');
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);