You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
567 B
TypeScript
21 lines
567 B
TypeScript
// 场景相机相关操作
|
|
import { Viewer, Cartesian3, Math } from 'cesium'
|
|
/**
|
|
* 将三维球定位到中国
|
|
* @param viewer :Viewer对象
|
|
*/
|
|
function flyToChina(viewer: Viewer) {
|
|
viewer.camera.flyTo({
|
|
destination: Cartesian3.fromDegrees(103.84, 31.15, 10350000),
|
|
orientation: {
|
|
heading: Math.toRadians(348.4202942851978),
|
|
pitch: Math.toRadians(-89.74026687972041),
|
|
roll: Math.toRadians(0),
|
|
},
|
|
complete: function callback() {
|
|
// 定位完成之后的回调函数
|
|
},
|
|
})
|
|
}
|
|
export { flyToChina }
|