| | |
| | | methods: { |
| | | init3DMap() { |
| | | //地图初始化 |
| | | window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | licenseServer: window.sceneConfig.licenseServer, |
| | | }) |
| | | // window.sgworld = new SmartEarth.SGWorld("Centermapdiv", { |
| | | // licenseServer: window.sceneConfig.licenseServer, |
| | | // }) |
| | | window.sgworld = new SmartEarth.SGWorld( |
| | | "Centermapdiv", |
| | | SmartEarthRootUrl + "Workers/image/earth.jpg", |
| | | function () {} |
| | | ) |
| | | |
| | | window.viewer = window.Viewer = window.sgworld._Viewer |
| | | Viewer.imageryLayers._layers[0].show = false |
| | | //定位 |
| | | // Viewer.camera.flyTo({ |
| | | // destination: Cesium.Cartesian3.fromDegrees(110, 33, 25000000), |
| | | // }) |
| | | // Viewer.camera.flyTo({ |
| | | // destination: { |
| | | // x: -10834926.182758586, |
| | | // y: 50483318.61217012, |
| | | // z: 38375099.7193183, |
| | | // }, |
| | | // orientation: { |
| | | // heading: 6.283185307179578, |
| | | // roll: 0, |
| | | // pitch: -1.56436861046299, |
| | | // }, |
| | | // }) |
| | | //开启 tick61.2 |
| | | // Viewer.imageryLayers._layers[0].show = false |
| | | |
| | | // Cesium.Camera.DEFAULT_VIEW_RECTANGLE = { |
| | | // west: -3.141592653589793, |
| | | // south: -1.5707963267948966, |
| | | // east: 3.141592653589793, |
| | | // north: 1.5707963267948966, |
| | | // } |
| | | |
| | | viewer.clock.shouldAnimate = true |
| | | // viewer.clock.shouldAnimate = true |
| | | //每次旋转的弧度 越小越慢 |
| | | var angle = Cesium.Math.toRadians(Math.PI * 1) |
| | | // 旋转次数 用来控制停止 |
| | |
| | | } |
| | | // 利用时钟进行监听 |
| | | viewer.clock.onTick.addEventListener(onTickCallback) |
| | | // setTimeout(() => { |
| | | // Viewer.camera.flyTo({ |
| | | // destination: { |
| | | // x: -4022999.313498903, |
| | | // y: 19214082.70976515, |
| | | // z: 13043510.373621361, |
| | | // }, |
| | | // orientation: { |
| | | // heading: 6.283185307179577, |
| | | // roll: 0, |
| | | // pitch: -1.5643686104630592, |
| | | // }, |
| | | // }) |
| | | // }, 1000) |
| | | |
| | | // setTimeout(() => { |
| | | // Viewer.camera.flyTo({ |
| | | // destination: { |
| | | // x: -3919623.6069864673, |
| | | // y: 13752070.475126158, |
| | | // z: 8307291.863719194, |
| | | // }, |
| | | // orientation: { |
| | | // heading: 6.283185307179582, |
| | | // roll: 0, |
| | | // pitch: -1.5707039123519846, |
| | | // }, |
| | | // }) |
| | | // }, 1000) |
| | | |
| | | Viewer.imageryLayers.addImageryProvider( |
| | | new Cesium.UrlTemplateImageryProvider({ |
| | | url: gaoDeBaseUrl[0].url, |