| | |
| | | Cesium.Cartographic.fromDegrees(longitude.value, latitude.value, 0) |
| | | ); |
| | | if (altHeight.value) { |
| | | altHeight.value = altHeight.value.toFixed(6); |
| | | altHeight.value = altHeight.value.toFixed(2); |
| | | } |
| | | } |
| | | }, SmartEarth.Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | |
| | | globe.ellipsoid.cartesianToCartographic(rightPosition); |
| | | var geodesic = new SmartEarth.Cesium.EllipsoidGeodesic(); |
| | | geodesic.setEndPoints(leftCartographic, rightCartographic); |
| | | rate.value = geodesic.surfaceDistance.toFixed(6); //分辨率 |
| | | rate.value = geodesic.surfaceDistance.toFixed(2); //分辨率 |
| | | }); |
| | | }; |
| | | const gridSwitch = () => { |
| | | gridIsshow.value = !gridIsshow.value; |
| | | if (gridIsshow.value) { |
| | | grid(10); |
| | | // getHeight(); |
| | | // createPrimitives(); |
| | | if (!window.graticules) { |
| | | window.graticules = new SmartEarth.Cesium.Graticules( |
| | | earthCtrl.Viewer, |
| | | SmartEarth.Cesium.Color.PALEGREEN |
| | | ); |
| | | |
| | | earthCtrl.Viewer.scene.preUpdate.addEventListener(function () { |
| | | window.graticules.update(); |
| | | }); |
| | | } else { |
| | | gridDel(); |
| | | window.graticules._enable = false; |
| | | } |
| | | // window.earthCtrl.wireframe = !window.earthCtrl.wireframe; |
| | | // gridIsshow.value = !gridIsshow.value; |
| | | // if (gridIsshow.value) { |
| | | // grid(10); |
| | | // // getHeight(); |
| | | // // createPrimitives(); |
| | | // } else { |
| | | // gridDel(); |
| | | // } |
| | | }; |
| | | const getHeight = () => { |
| | | let removeListener = Viewer.camera.changed.addEventListener(() => { |