From c4ffe86a182a3a4fe1bbf00fe57e281a42fb2eeb Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 31 八月 2023 15:46:02 +0800
Subject: [PATCH] sdk版本更新,图层管理加载图层优化;空间查询图形下载优化

---
 src/components/mouseMove.vue |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/components/mouseMove.vue b/src/components/mouseMove.vue
index dd80289..0e06feb 100644
--- a/src/components/mouseMove.vue
+++ b/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(() => {

--
Gitblit v1.9.3