| | |
| | | <div class="earthLable">{{ longitude }}</div> |
| | | <div class="earthLable">纬度 :</div> |
| | | <div class="earthLable">{{ latitude }}</div> |
| | | <div class="earthLable">地形高度 :</div> |
| | | <div class="earthLable">{{ altHeight }} </div> |
| | | <div class="earthLable">米</div> |
| | | <div class="earthLable">视角高度 :</div> |
| | | <div class="earthLable">{{ alt }} </div> |
| | | <div class="earthLable">千米</div> |
| | |
| | | const latitude = ref("0.00"); |
| | | const rate = ref("0.00"); |
| | | const alt = ref("0.00"); |
| | | const alheight = ref("0.00"); |
| | | const altHeight = ref("0.00"); |
| | | |
| | | let entitiesObj = reactive({ |
| | | lonLine: [], |
| | |
| | | latitude.value = SmartEarth.Cesium.Math.toDegrees( |
| | | cartographic.latitude |
| | | ).toFixed(6); |
| | | altHeight.value = window.Viewer.scene.globe.getHeight( |
| | | Cesium.Cartographic.fromDegrees(longitude.value, latitude.value, 0) |
| | | ); |
| | | if (altHeight.value) { |
| | | altHeight.value = altHeight.value.toFixed(6); |
| | | } |
| | | } |
| | | }, SmartEarth.Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | |
| | | Viewer.camera.changed.addEventListener(() => { |
| | | // 视高 km |
| | | let camera_alt = (Viewer.camera.positionCartographic.height / 1000).toFixed( |
| | | 2 |
| | | ); |
| | | alt.value = camera_alt; |
| | | let scene = window.Viewer.scene; |
| | | // 获取画布的大小 |
| | | var width = scene.canvas.clientWidth; |
| | |
| | | var geodesic = new SmartEarth.Cesium.EllipsoidGeodesic(); |
| | | geodesic.setEndPoints(leftCartographic, rightCartographic); |
| | | rate.value = geodesic.surfaceDistance.toFixed(6); //分辨率 |
| | | } |
| | | }, SmartEarth.Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | |
| | | Viewer.camera.changed.addEventListener(() => { |
| | | // 视高 km |
| | | let camera_alt = (Viewer.camera.positionCartographic.height / 1000).toFixed( |
| | | 2 |
| | | ); |
| | | alt.value = camera_alt; |
| | | // // 方位角 |
| | | // let heading = Cesium.Math.toDegrees(viewer.camera.heading).toFixed(2); |
| | | // // 俯仰角 |
| | | // let pitch = Cesium.Math.toDegrees(viewer.camera.pitch).toFixed(2); |
| | | // // 翻滚角 |
| | | // let roll = Cesium.Math.toDegrees(viewer.camera.roll).toFixed(2); |
| | | // // 级别 |
| | | // let level = 0; |
| | | // let tileRender = viewer.scene._globe._surface._tilesToRender; |
| | | // if (tileRender && tileRender.length > 0) { |
| | | // level = viewer.scene._globe._surface._tilesToRender[0]._level; |
| | | // } |
| | | }); |
| | | }; |
| | | const gridSwitch = () => { |