月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-08-31 c4ffe86a182a3a4fe1bbf00fe57e281a42fb2eeb
src/components/mouseMove.vue
@@ -76,7 +76,7 @@
        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);
@@ -110,18 +110,31 @@
      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(() => {