先选好位置,并调整好视角,然后按 F12 打开控制台分别输入:
viewer.camera.position
viewer.camera.heading
viewer.camera.pitch
viewer.camera.roll
来分别获取你选好的位置的坐标,视角等信息,然后利用 viewer.camera.setView 进行设置。
viewer.camera.setView({
// Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
// fromDegrees()方法,将经纬度和高程转换为世界坐标
destination: Cesium.Cartesian3.fromDegrees(112.962475, 28.195802, 1500),
orientation: {
// 指向
heading: 6.283185307179581,
// 视角
pitch: -1.5688168484696687,
roll: 0.0
}
});
或
viewer.camera.setView({
destination: { x: -2195017.3883226076, y: 5180529.602231502, z: 2996108.378261628 },
orientation: {
heading: 6.283185307179581,
pitch: -1.5688168484696687,
roll: 0.0
}
});
标签:视角,viewer,camera,pitch,Cesium,roll,加载
From: https://www.cnblogs.com/marshban/p/17379597.html