无人机管理后台前端(已迁走)
shuishen
2025-09-11 b5d3e5db9ef39cd0bdf6b49246be6818a58d731c
src/utils/cesium/publicCesium.js
@@ -193,11 +193,12 @@
         gl = null
         this.viewer?.destroy() // 销毁Viewer实例
         this.viewer = null
         var cesiumContainer = document.getElementById(this.viewerDom)
         if (cesiumContainer && removeDom) {
            cesiumContainer.remove() // 移除与地图相关的DOM元素
            this.viewerDom = null
         }
         // var cesiumContainer = document.getElementById(this.viewerDom)
         // if (cesiumContainer && removeDom) {
         //    cesiumContainer.remove() // 移除与地图相关的DOM元素
         //    this.viewerDom = null
         // }
         this.viewerDom = null
      }
   }
@@ -209,7 +210,7 @@
   async switchContour (open) {
      if (open) {
         await this.boundary?.openContour()
      } else {
         this.boundary?.closeContour()
      }
@@ -752,7 +753,7 @@
         Cesium.Cartesian3.subtract(a, this.viewer?.camera.position, a),
         Cesium.Cartesian3.normalize(r, r),
         Cesium.Cartesian3.normalize(a, a)) : (r = c.direction,
         a = h.direction)
            a = h.direction)
      let d = Cesium.Cartesian3.dot(r, a)
         , p = 0
      return d < 1 && (p = Math.acos(d)),
@@ -781,7 +782,7 @@
            , r = Cesium.Math.acosClamped(-e)
         a > 0 && a > r && (a = r - Cesium.Math.EPSILON4),
            r = Cesium.Math.acosClamped(e),
         a < 0 && -a > r && (a = -r + Cesium.Math.EPSILON4)
            a < 0 && -a > r && (a = -r + Cesium.Math.EPSILON4)
      }
      return a
   }