| | |
| | | <template> |
| | | <div |
| | | class="mouseBox" |
| | | @setMouseMove="setMouseMove" |
| | | > |
| | | <div |
| | | class="earthImage" |
| | | :class="{ active: gridIsshow }" |
| | | @click="gridSwitch" |
| | | ></div> |
| | | <div class="mouseBox" @setMouseMove="setMouseMove"> |
| | | <div class="earthImage" :class="{ active: gridIsshow }" @click="gridSwitch"></div> |
| | | <div class="earthLable">经度 :</div> |
| | | <div class="earthLable">{{ longitude }}</div> |
| | | <div class="earthLable">纬度 :</div> |
| | |
| | | let handlerPoint = new SmartEarth.Cesium.ScreenSpaceEventHandler( |
| | | window.Viewer.scene.canvas |
| | | ); |
| | | const pickGlobeSlope = new SmartEarth.Cesium.PickGlobeSlope(earthCtrl.Viewer) |
| | | var ellipsoid = window.Viewer.scene.globe.ellipsoid; |
| | | handlerPoint.setInputAction(function (movement) { |
| | | handlerPoint.setInputAction((movement) => { |
| | | //捕获椭球体,将笛卡尔二维平面坐标转为椭球体的笛卡尔三维坐标,返回球体表面的点 |
| | | var cartesian = window.Viewer.camera.pickEllipsoid( |
| | | movement.endPosition, |
| | | ellipsoid |
| | | ); |
| | | |
| | | if (cartesian) { |
| | | //将笛卡尔三维坐标转为地图坐标(弧度) |
| | | var cartographic = |
| | |
| | | padding-right: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .earthImage { |
| | | width: 20px; |
| | | height: 20px; |
| | |
| | | margin-left: 10px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .earthLable { |
| | | font-size: 16px; |
| | | font-family: Source Han Sans CN; |
| | |
| | | line-height: 5px; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .active { |
| | | background-color: #171e2e; |
| | | border: 1px solid; |