From a35f963076eecf415487e4c9cc4c102903fec4d2 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期三, 01 十一月 2023 17:11:15 +0800
Subject: [PATCH] 会议保障历史记录+跳转标准地平台

---
 static/CimSDK/index.cjs                 |    2 
 src/components/left/layerTree/Layer.vue |  206 ++++++++++++++++++++++++-
 src/components/menu/bottom-menu.vue     |   23 ++
 src/store/index.js                      |    7 
 static/CimSDK/index.js                  |    2 
 src/components/left/lefttop.vue         |    5 
 src/components/left/leftmenu.vue        |   24 +-
 static/CimSDK/CimSDK.min.js             |    2 
 src/components/menu/tools/roam.vue      |  175 ++++++++++++++++-----
 src/components/map/viewer.vue           |    6 
 10 files changed, 374 insertions(+), 78 deletions(-)

diff --git a/src/components/left/layerTree/Layer.vue b/src/components/left/layerTree/Layer.vue
index 06b73bb..d133a86 100644
--- a/src/components/left/layerTree/Layer.vue
+++ b/src/components/left/layerTree/Layer.vue
@@ -19,18 +19,38 @@
             <el-button
               class="button-user"
               type="primary"
-              size="mini"
               slot="trigger"
               icon="el-icon-folder-opened"
-              title="鎵撳紑閰嶇疆鏂囦欢"
+              title="鎵撳紑鏈湴閰嶇疆鏂囦欢"
             ></el-button>
             <el-button
               class="button-user"
               type="primary"
-              size="mini"
               icon="el-icon-download"
-              title="淇濆瓨閰嶇疆鏂囦欢"
+              title="淇濆瓨涓烘湰鍦伴厤缃枃浠�"
               @click.stop="save"
+            ></el-button>
+            <el-button
+              class="button-user"
+              type="primary"
+              icon="el-icon-delete"
+              title="娓呴櫎鎵�鏈夋爣缁�"
+              @click.stop="deleteAllPlot"
+            ></el-button>
+            <el-button
+              class="button-user"
+              type="primary"
+              icon="el-icon-upload"
+              title="涓婁紶鑷虫湇鍔″櫒"
+              @click.stop="saveHistoryPlot"
+            ></el-button>
+
+            <el-button
+              class="button-user historyBtn"
+              type="primary"
+              icon="el-icon-s-order"
+              title="浼氳淇濋殰鍘嗗彶璁板綍"
+              @click.stop="histotyPlotting"
             ></el-button>
           </el-upload>
         </div>
@@ -148,6 +168,18 @@
 import SaveScene from "./SaveScene.vue";
 // 宸ョ▼鏍戝伐鍏�
 let _treeTool;
+function arrGroup(arr, fn) {
+  const obj = {};
+  arr.forEach((item) => {
+    const key = JSON.stringify(fn(item));
+    obj[key] = obj[key] || [];
+    obj[key].push(item);
+  });
+  return Object.keys(obj).map((k) => {
+    return obj[k];
+  });
+}
+
 export default {
   name: "Layer",
   components: {
@@ -323,12 +355,166 @@
       };
       reader.readAsText(file.raw);
     },
+    // 鏍囩粯涓婁紶鑷虫湇鍔″櫒
+    saveHistoryPlot() {
+      if (this.treeData.length == 0) {
+        this.$message.error("璇峰厛杩涜鏍囩粯");
+        return;
+      } else if (this.treeData.length > 1) {
+        this.$message.error("鏍煎紡涓嶆纭紝璇蜂慨鏀瑰悗閲嶆柊淇濆瓨");
+        return;
+      }
+      this.$confirm("鏄惁灏嗗綋鍓嶄細璁繚闅滄爣缁樻暟鎹笂浼犺嚦鏈嶅姟鍣�?", "涓婁紶", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          let oricontent = JSON.stringify(this.treeData);
+          let content = oricontent.replace(
+            /"checked":true/g,
+            '"checked":false'
+          );
+          const uploading = this.$loading({
+            lock: true,
+            text: "浼氳淇濋殰鏍囩粯鏁版嵁涓婁紶涓紝璇风◢鍚�",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          axios({
+            method: "POST",
+            url: "http://10.10.4.121:8070/PM20221203225_OpenAPI3_Service-0.0.1-SNAPSHOT/biaoHui/add",
+            data: {
+              userId: this.$store.state.userId,
+              userName: this.$store.state.userName,
+              geojsonName: this.treeData[0].name,
+              geojsonString: content,
+            },
+          }).then(
+            (response) => {
+              uploading.close();
+              if (response.data.code == 200) {
+                this.$message({
+                  message: "淇濆瓨鎴愬姛",
+                  type: "success",
+                });
+              } else {
+                this.$message.error("淇濆瓨澶辫触锛�");
+              }
+            },
+            (error) => {
+              uploading.close();
+              this.$message.error("鏁版嵁涓婁紶澶辫触");
+              // console.log("閿欒", error.message);
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "宸插彇娑堜笂浼�",
+          });
+        });
+    },
+    // 鍔犺浇鍘嗗彶鏍囩粯鏁版嵁
+    histotyPlotting() {
+      this.$confirm(
+        "璇ユ搷浣滃皢浼氬鑷村綋鍓嶆爣缁樻暟鎹瑕嗙洊锛屾槸鍚︾户缁�?",
+        "浼氳淇濋殰鍘嗗彶鏁版嵁",
+        {
+          confirmButtonText: "纭畾",
+          cancelButtonText: "鍙栨秷",
+          type: "warning",
+          // customClass: "msgbox",
+        }
+      )
+        .then(() => {
+          const downloading = this.$loading({
+            lock: true,
+            text: "浼氳淇濋殰鍘嗗彶鏁版嵁鍔犺浇涓紝璇风◢鍚�",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.7)",
+          });
+          let that = this;
+          axios({
+            method: "POST",
+            url: "http://10.10.4.121:8070/PM20221203225_OpenAPI3_Service-0.0.1-SNAPSHOT/biaoHui/list",
+            data: {
+              userId: this.$store.state.userId,
+            },
+          }).then(
+            (response) => {
+              setTimeout(() => {
+                downloading.close();
+                let plottingArr = [];
+                response.data.result.forEach((item) => {
+                  let geoJsonObj = JSON.parse(item.geojsonString);
+                  plottingArr.push(geoJsonObj[0]);
+                });
+                const newArr = arrGroup(plottingArr, (item) => item.name);
+                let finalPlotting = [];
+                newArr.map((a) => {
+                  let newObj = {};
+                  a.map((b) => {
+                    if (newObj.children) {
+                      newObj.children = newObj.children.concat(b.children);
+                    } else {
+                      newObj = b;
+                    }
+                  });
+                  finalPlotting.push(newObj);
+                });
+                let json = {
+                  name: "涓�寮犲浘",
+                  id: 1,
+                  open: true,
+                  children: finalPlotting,
+                };
+                that.initData(json);
+              }, 2000);
+            },
+            (error) => {
+              setTimeout(() => {
+                downloading.close();
+                // console.log("閿欒", error.message);
+                this.$message.error("鏁版嵁璇锋眰澶辫触");
+              }, 2000);
+            }
+          );
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "宸插彇娑堝姞杞�",
+          });
+        });
+    },
+    // 娓呴櫎鏈湴鎵�鏈夋爣缁樹俊鎭�
+    deleteAllPlot() {
+      this.$confirm("璇ユ搷浣滃皢娓呴櫎鎵�鏈夋爣缁樹俊鎭紝鏄惁缁х画?", "娓呴櫎", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+      })
+        .then(() => {
+          this.$message({
+            message: "鏍囩粯鏁版嵁宸叉竻闄�",
+            type: "success",
+          });
+          this.initData({});
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "宸插彇娑堟竻闄�",
+          });
+        });
+    },
     // 鍒濆鍖栨暟鎹�
     initData(data) {
       if (this.treeData.length) {
         this.removeChildData(this.treeData);
       }
-
       data.name && sessionStorage.setItem("SmartEarthTitle", data.name);
       // 璁剧疆宸ョ▼鏍戞暟鎹�
       this.setTreeData(data.children);
@@ -706,8 +892,6 @@
         open: true,
         children: this.treeData,
       };
-      console.log(this.treeData);
-      debugger;
       let content = JSON.stringify(data);
       let blob = new Blob([content], { type: "" });
       var reader = new FileReader();
@@ -727,6 +911,7 @@
     rightClick(e, data, node, comp) {
       this.isClickParent = !!data.children;
       this.selectNode = data;
+      console.log(this.selectNode);
       this.rightClickMenuStyle = { top: e.pageY + "px", left: e.pageX + "px" };
       this.rightClickMenuDisplay = true;
       document.onclick = (e) => {
@@ -845,6 +1030,9 @@
 /deep/.button-user i {
   color: #ffffff !important;
 }
+.historyBtn {
+  margin-left: 28px;
+}
 .closeBtn {
   color: white;
   position: relative;
@@ -874,7 +1062,7 @@
 }
 
 .wdzy {
-  width: 320px;
+  width: 335px;
   /* height: 100%; */
   max-height: 360px;
   overflow-y: auto;
@@ -887,7 +1075,7 @@
 .closePanel {
   position: absolute;
   right: 12px;
-  top: 6px;
+  top: 10px;
   font-size: 18px;
   line-height: 30px;
   background-color: rgba(255, 255, 255, 0.5);
diff --git a/src/components/left/leftmenu.vue b/src/components/left/leftmenu.vue
index b3fbb7f..93e46f8 100644
--- a/src/components/left/leftmenu.vue
+++ b/src/components/left/leftmenu.vue
@@ -464,18 +464,18 @@
     //鑾峰彇token骞惰姹傚姞杞藉浘灞傛暟鎹�
     this.SmartEarthToken = common.smartearthtoken;
     this.$nextTick(() => {
-      getmenu().then((response) => {
-        // // 寰楀埌榛樿閫変腑鐨勬暟鎹殑id
-        // this.parseJson(response.data); //鍦烘櫙閰嶇疆
-        // this.treeData = response.data;
-        // this.setDefaultCheck(response.data);
-        //   setTimeout(() => {
-        //     this.randomSelectLayer();
-        //     let selectedLayers = this.$refs.tree.getCheckedNodes();
-        //     // .filter((item) => item.sourceType == "cluster");
-        //     this.$store.commit("selectedLayer", selectedLayers);
-        //   }, 1000);
-      });
+      // getmenu().then((response) => {
+      //   // // 寰楀埌榛樿閫変腑鐨勬暟鎹殑id
+      //   // this.parseJson(response.data); //鍦烘櫙閰嶇疆
+      //   // this.treeData = response.data;
+      //   // this.setDefaultCheck(response.data);
+      //   //   setTimeout(() => {
+      //   //     this.randomSelectLayer();
+      //   //     let selectedLayers = this.$refs.tree.getCheckedNodes();
+      //   //     // .filter((item) => item.sourceType == "cluster");
+      //   //     this.$store.commit("selectedLayer", selectedLayers);
+      //   //   }, 1000);
+      // });
       this.getLayersData("./static/layers.json");
       // axios.get("./static/layers.json").then(
       //   (response) => {
diff --git a/src/components/left/lefttop.vue b/src/components/left/lefttop.vue
index 8c47871..e60a5e3 100644
--- a/src/components/left/lefttop.vue
+++ b/src/components/left/lefttop.vue
@@ -88,6 +88,11 @@
     getUserInfo().then((res) => {
       if (res.code == 200) {
         this.nickName = res.data.nickName;
+        let userInfo = {
+          userId: res.data.userId,
+          userName: res.data.userName,
+        };
+        this.$store.commit("saveUserInfo", userInfo);
       }
     });
   },
diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue
index 99fb0d1..0d14e3a 100644
--- a/src/components/map/viewer.vue
+++ b/src/components/map/viewer.vue
@@ -87,8 +87,8 @@
       window.sgworld = new SmartEarth.EarthCtrl(
         "sdkContainer",
         {
-          StaticFileBaseUrl: "../../../static/CimSDK/",
-          // StaticFileBaseUrl: "../../../SW/static/CimSDK/",
+          // StaticFileBaseUrl: "../../../static/CimSDK/",
+          StaticFileBaseUrl: "../../../SW/static/CimSDK/",//
         },
         {},
         {},
@@ -203,8 +203,8 @@
         },
       });
       //鍒濆鍖栧脊绐椾簨浠�
+      // that.showBottom();
       that.initLayerOpen();
-      that.showBottom();
     });
     let size = this.detectZoom();
     this.scale = (100 / size).toFixed(2);
diff --git a/src/components/menu/bottom-menu.vue b/src/components/menu/bottom-menu.vue
index 9c5cf12..c4bbc7b 100644
--- a/src/components/menu/bottom-menu.vue
+++ b/src/components/menu/bottom-menu.vue
@@ -30,12 +30,16 @@
           :append-to-body="false"
           class="popper-dropdown"
         >
-          <el-dropdown-item command="spjkHandle"
-            >瑙嗛闆嗘垚涓庡彲瑙嗗寲</el-dropdown-item
-          >
           <el-dropdown-item command="stdsjHandle"
             >瑙嗗浘澶ф暟鎹钩鍙�</el-dropdown-item
           >
+          <el-dropdown-item command="bzdSystem"
+            >鏍囧噯鍦扮洃绠″钩鍙�</el-dropdown-item
+          >
+          <el-dropdown-item command="spjkHandle"
+            >瑙嗛闆嗘垚涓庡彲瑙嗗寲</el-dropdown-item
+          >
+
           <el-dropdown-item v-if="isShowSjxl" command="sjxlHandle"
             >鎵嬫満淇′护鐑姏鍒嗗竷</el-dropdown-item
           >
@@ -338,7 +342,7 @@
   border: none;
 }
 .csbj .el-dropdown-menu {
-  top: -180px !important;
+  top: -215px !important;
 }
 .jxmx .el-dropdown-menu {
   top: -110px !important;
@@ -355,7 +359,7 @@
   border-top-color: rgba(14, 50, 143, 0.6);
   border-top-width: 6px;
   border-bottom-width: 0;
-  top: 166px;
+  top: 201px;
   left: 37px;
 }
 .jxmx .el-popper /deep/ .popper__arrow::after {
@@ -636,6 +640,9 @@
         case "stdsjHandle":
           this.stdsjHandle();
           break;
+        case "bzdSystem":
+          this.bzdSystem();
+          break;
         case "fcfhHandle":
           this.fencengfenhu();
           break;
@@ -662,6 +669,11 @@
     stdsjHandle() {
       window.open(
         "http://10.9.2.29:8080/#/login?token=1ed14c5157acb8088efe65bc93a032c3"
+      );
+    },
+    bzdSystem() {
+      window.open(
+        "http://192.162.24.2:8076/login"
       );
     },
     shoujixinling() {
@@ -766,7 +778,6 @@
     // 鍒嗗眰鍒嗘埛
     fencengfenhu() {
       Bus.$emit("ShowFCFH", true);
-
     },
     // 鏈哄櫒浜哄ぇ浼氳棰戣瀺鍚�
     async jiqirendahui(item) {
diff --git a/src/components/menu/tools/roam.vue b/src/components/menu/tools/roam.vue
index 9d0bb4d..696cb47 100644
--- a/src/components/menu/tools/roam.vue
+++ b/src/components/menu/tools/roam.vue
@@ -9,8 +9,7 @@
           placement="top-start"
           popper-class="item_tooltip"
         >
-          <el-button>
-            <img src="@/assets/img/right/my/ljmy1.png" /> </el-button
+          <el-button> <img src="@/assets/img/right/my/ljmy1.png" /> </el-button
         ></el-tooltip>
       </div>
       <div class="roamTool" @click="pointFly">
@@ -21,11 +20,10 @@
           placement="top-start"
           popper-class="item_tooltip"
         >
-          <el-button>
-            <img src="@/assets/img/right/my/ddrf1.png" /> </el-button
+          <el-button> <img src="@/assets/img/right/my/ddrf1.png" /> </el-button
         ></el-tooltip>
       </div>
-      <div class="roamTool" @click="digitalCityHandle">
+      <!-- <div class="roamTool" @click="digitalCityHandle">
         <el-tooltip
           class="item"
           effect="dark"
@@ -33,8 +31,40 @@
           placement="top-start"
           popper-class="item_tooltip"
         >
-          <el-button>
-            <img src="@/assets/img/left/tx/kjbj.png" /> </el-button
+          <el-button> <img src="@/assets/img/left/tx/kjbj.png" /> </el-button
+        ></el-tooltip>
+      </div> -->
+      <div class="roamTool" @click="setRomanFly('鏍稿績鍖烘极娓�')">
+        <el-tooltip
+          class="item"
+          effect="dark"
+          content="鏍稿績鍖烘极娓�"
+          placement="top-start"
+          popper-class="item_tooltip"
+        >
+          <el-button> <img src="@/assets/img/left/tx/ll.png" /> </el-button
+        ></el-tooltip>
+      </div>
+       <div class="roamTool" @click="setRomanFly('鏅缁垮湴')">
+        <el-tooltip
+          class="item"
+          effect="dark"
+          content="鏅缁垮湴"
+          placement="top-start"
+          popper-class="item_tooltip"
+        >
+          <el-button> <img src="@/assets/img/left/tx/ll.png" /> </el-button
+        ></el-tooltip>
+      </div>
+       <div class="roamTool" @click="setRomanFly('鏀垮姟鏈嶅姟绐楀彛')">
+        <el-tooltip
+          class="item"
+          effect="dark"
+          content="鏀垮姟鏈嶅姟绐楀彛"
+          placement="top-start"
+          popper-class="item_tooltip"
+        >
+          <el-button> <img src="@/assets/img/left/tx/ll.png" /> </el-button
         ></el-tooltip>
       </div>
     </div>
@@ -54,7 +84,7 @@
   /* border-radius: 30px; */
   box-shadow: 0px 0px 10px rgba(101, 180, 253, 0.8) inset;
   background-color: rgba(5, 39, 126, 0.7);
-  width: 200px;
+  width: 300px;
 }
 .roamTools {
   margin-left: 20px;
@@ -67,8 +97,8 @@
   height: 40px;
   margin: 5px;
 }
-.roamTool img{
-    margin: 4px;
+.roamTool img {
+  margin: 4px;
 }
 .roamTool:hover {
   background: rgba(0, 168, 255, 0.16);
@@ -123,7 +153,7 @@
 
 <script>
 window.PathAnimationData = {
-  isFly: false
+  isFly: false,
 };
 export default {
   name: "roam",
@@ -133,8 +163,8 @@
       isOpen: {
         pathRoaming: false,
         pointFly: false,
-        digitalCity: false
-      }
+        digitalCity: false,
+      },
     };
   },
   mounted() {
@@ -171,7 +201,7 @@
       }
       window.corePos = {
         lon: 116.51296,
-        lat: 39.80143
+        lat: 39.80143,
       };
       window.dCtiy = {};
 
@@ -182,11 +212,11 @@
         {
           effects: true,
           effectsMaxHeight: 60,
-          colors: "rgba(0,127,255,1)"
+          colors: "rgba(0,127,255,1)",
         },
         "0",
         true,
-        data => {
+        (data) => {
           Viewer.zoomTo(data.item);
         }
       );
@@ -198,13 +228,13 @@
         width: 4.0, //绾跨殑瀹藉害
         pointColor: "#FFFFFF", //绉诲姩鐐圭殑棰滆壊
         speed: 8,
-        far: 200000
+        far: 200000,
       });
 
       //姘撮潰
       window.dCtiy.waterLayer = sgworld.Creator.createWaterPolygonLayer({
         url: "./static/water.json",
-        speed: 5
+        speed: 5,
       });
 
       // window.dCtiy.layers = sgworld.Creator.createUrlTemplateImageryProvider('tms鏈嶅姟', {
@@ -220,7 +250,7 @@
           enablePickFeatures: false,
           level: "0,26",
           tilingScheme: new Cesium.GeographicTilingScheme(),
-          alpha: 1
+          alpha: 1,
         },
         "0",
         undefined,
@@ -231,7 +261,7 @@
         this.setEffectVisibility(true);
       } else {
         window.sceneObj = [];
-        window.KEYPOIS.forEach(item => {
+        window.KEYPOIS.forEach((item) => {
           this.addDRW(item);
         });
 
@@ -254,10 +284,10 @@
         position: {
           lon: window.corePos.lon,
           lat: window.corePos.lat,
-          height: 180
+          height: 180,
         },
         multiple: 2.0,
-        scale: new Cesium.Cartesian3(30, 30, 30)
+        scale: new Cesium.Cartesian3(30, 30, 30),
       });
       window.sceneObj.push(Tetrahedrod);
     },
@@ -267,7 +297,7 @@
         west: 116.48379,
         south: 39.74328,
         east: 116.58084,
-        north: 39.81983
+        north: 39.81983,
       };
       let max = 800;
       let min = 500;
@@ -281,7 +311,7 @@
       let effect = sgworld.Creator.createFlyingLine(positions, {
         time: 2500,
         color: "#ffff00",
-        far: 20000
+        far: 20000,
       });
       window.sceneObj.push(effect);
     },
@@ -291,9 +321,9 @@
         position: {
           lon: window.corePos.lon,
           lat: window.corePos.lat,
-          height: 10
+          height: 10,
         },
-        radius: 1300
+        radius: 1300,
       });
       window.sceneObj.push(circle);
     },
@@ -302,7 +332,7 @@
       var center = {
         lon: window.corePos.lon,
         lat: window.corePos.lat,
-        height: 180
+        height: 180,
       };
       var cities = [
         { lon: 116.47861, lat: 39.80373 },
@@ -313,7 +343,7 @@
         { lon: 116.59732, lat: 39.78358 },
         { lon: 116.55501, lat: 39.77515 },
         { lon: 116.49845, lat: 39.75524 },
-        { lon: 116.4882, lat: 39.78245 }
+        { lon: 116.4882, lat: 39.78245 },
       ];
       let effect = sgworld.Creator.createTrailLinePath(center, cities, {
         width: 3, //绾垮锛堝彲閫夛級
@@ -321,11 +351,11 @@
         color: "#00ffff", //绾块鑹诧紙鍙�夛級,
         LightSpot: true, //鏄惁浣跨敤鍏夌偣鏁堟灉锛堝彲閫夛級
         LightSpotColor: "#ffffff", //鍏夌偣棰滆壊锛堝彲閫夛級
-        far: 40000
+        far: 40000,
       });
       window.sceneObj.push(effect);
 
-      cities.forEach(item => {
+      cities.forEach((item) => {
         this.addDRW(item);
       });
     },
@@ -345,9 +375,9 @@
         position: {
           lon: item.lon,
           lat: item.lat,
-          height: 1
+          height: 1,
         },
-        color: color
+        color: color,
       });
       window.sceneObj.push(circle);
 
@@ -366,11 +396,11 @@
         position: {
           lon: item.lon,
           lat: item.lat,
-          height: 1
+          height: 1,
         },
         color: color,
         radius: 6,
-        length: 300
+        length: 300,
       });
       window.sceneObj.push(cone);
 
@@ -395,7 +425,7 @@
         {
           FontName: `16px SimSun`,
           IconColor: "#FFFFFF",
-          MaxViewingHeight: 118500
+          MaxViewingHeight: 118500,
         },
         0,
         ""
@@ -407,11 +437,11 @@
         position: {
           lon: window.corePos.lon,
           lat: window.corePos.lat,
-          height: 0
+          height: 0,
         },
         radius: 1300,
         length: 200,
-        multiple: 1.5
+        multiple: 1.5,
       });
       window.sceneObj.push(effect);
     },
@@ -435,7 +465,7 @@
 
       // this.isOpen["pathRoaming"] = true;
 
-      sgworld.drawObj = sgworld.Command.execute(2, 3, "", data => {
+      sgworld.drawObj = sgworld.Command.execute(2, 3, "", (data) => {
         if (!PathAnimationData.isFly) {
           data.showPoint = false;
           data.showLine = true;
@@ -458,15 +488,15 @@
                 PathAnimationData.fly && PathAnimationData.fly.exit();
                 layuiLayer.close(PathAnimationData.win_index);
                 PathAnimationData = {
-                  isFly: false
+                  isFly: false,
                 };
 
                 this.isOpen.pathRoaming = false;
               },
-              success: function(layero, index) {
+              success: function (layero, index) {
                 PathAnimationData.win_index = index;
-              }
-            }
+              },
+            },
           });
         }
       });
@@ -493,9 +523,64 @@
       sgworld.drawObj = sgworld.Analysis.setPointFly({
         end: () => {
           this.isOpen["pointFly"] = false;
-        }
+        },
       });
-    }
-  }
+    },
+    setRomanFly(params) {
+      let degreesArr = [];
+      switch (params) {
+        case "鏍稿績鍖烘极娓�":
+          degreesArr = [
+            116.493479, 39.80450483, 34.01816465, 116.5138085, 39.77947026,
+            31.63330385,
+          ];
+          break;
+        case "鏅缁垮湴":
+          degreesArr = [
+            116.4541689, 39.78062456, 30.4788207, 116.4618767, 39.7963431,
+            31.87381588, 116.4687937, 39.79241793, 31.19379078, 116.4742798,
+            39.78913405, 30.11803782, 116.4807703, 39.78743941, 31.48027437,
+            116.4895578, 39.77782452, 32.63986152, 116.5090257, 39.77228768,
+            30.07838461, 116.5147722, 39.76975519, 29.24082306, 116.5189657,
+            39.76649988, 28.75245888, 116.5208586, 39.76202203, 27.34821356,
+            116.5231743, 39.76039621, 27.75346174, 116.5353151, 39.76020156,
+            22.34613339, 116.5555339, 39.76965707, 30.11293431, 116.5624811,
+            39.77186726, 22.65879449, 116.5722676, 39.7769284, 27.11119094,
+          ];
+          break;
+
+        case "鏀垮姟鏈嶅姟绐楀彛":
+          degreesArr = [
+            116.4961244, 39.80126862, 34.60044298, 116.4976219, 39.80200891,
+            34.02444896, 116.500233, 39.79879928, 36.14055497, 116.5028255,
+            39.79557196, 41.58378157, 116.5013282, 39.79495417, 35.38227236,
+            116.4963272, 39.80094707, 33.82085563,
+          ];
+          break;
+      }
+
+      sgworld.Creator.getFlyData(degreesArr, (data) => {
+        data.showPoint = false;
+        data.showLine = true;
+        data.mode = 0;
+        // 寮圭獥鏁版嵁
+        window.PathAnimationData = {
+          flyData: data,
+        };
+        window.PathAnimationData.winIndex = layer.open({
+          type: 2,
+          title: "璺緞鍔ㄧ敾",
+          shade: false,
+          area: ["352px", "690px"],
+          offset: "r",
+          skin: "other-class",
+          content: SmartEarthRootUrl + "Workers/path/Path.html",
+          end: function () {
+            PathAnimationData.fly && PathAnimationData.fly.exit();
+          },
+        });
+      });
+    },
+  },
 };
 </script>
diff --git a/src/store/index.js b/src/store/index.js
index f518161..27cb7b7 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -30,12 +30,19 @@
     isShowHistory: false,
     description: {},
     selectedLayers: [],
+    userId: "",
+    userName: "",
     // layerData: {}
   },
   mutations: {
     selectedLayer(state, b) {
       state.selectedLayers = b
     },
+    saveUserInfo(state, b) {
+      state.userId = b.userId
+      state.userName = b.userName
+    },
+
     showHistory(state, b) {
       state.isShowHistory = b
     },
diff --git a/static/CimSDK/CimSDK.min.js b/static/CimSDK/CimSDK.min.js
index a03fbc2..ec72591 100644
--- a/static/CimSDK/CimSDK.min.js
+++ b/static/CimSDK/CimSDK.min.js
@@ -21258,7 +21258,7 @@
     if (czm_seWaterHeight > -5000.0 && v_elevationPos.z < czm_seWaterHeight) { discard; }  
     gltf_seWater_main(); 
 } 
-`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function hBi(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function dBi(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function gBi(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function fBi(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new dBi({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=gBi(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=hBi(x,o),x._model._vertexShaderLoaded=uBi(x,o),x._model._fragmentShaderLoaded=cBi(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function pBi(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;fBi(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Zet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}Xx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};Xx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};Xx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};Xx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};Xx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};Xx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};Xx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};Xx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};Xx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};Xx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var Att=Xx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Gm(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Gm()+Gm()}-${Gm()}-${Gm()}-${Gm()}-${Gm()}${Gm()}${Gm()}`};es.createUUIDWithoutDash=function(){return Gm()+Gm()+Gm()+Gm()+Gm()+Gm()+Gm()+Gm()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new l3;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new une(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new hne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new mD({})};es.prototype.createFeatureLayer=function(o,A){let f=new pne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new gne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new ZO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new Hre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new lY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new wre(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new bet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new bre(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new Qet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new l3(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new Dre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new Tre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new Rre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new Fre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new kre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new ket(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Oet(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new Ine(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=Pet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new zre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new Ore(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new Jre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new Wre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new jre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new Zre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new ine(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new ene(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new nne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new ane(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new lne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new Cne(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Het(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new xne(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new vne(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Wet;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new qet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new jet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new Xet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new Att(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var vb=es;var wne=class extends Kd{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new Bre(A);let m=new l3(A);m.id=vb.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new PP("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(wne.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var bne=wne;function utt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var pFi=new Oa,mFi=new Z,CFi=new Z;utt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var ctt=utt;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=vb.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=vb.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(vb.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&Q6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&Q6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&Q6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&Q6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&Q6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function Q6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function mBi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&Q6(o,A.childNodes,m)}function CBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function EBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function IBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function xBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function yBi(o,A,f){o.coreMap.scene.skyBox=new VN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function vBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function _Bi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function BBi(o,A,f){o.factory.createModel(A,f)}function wBi(o,A,f){o.factory.createWaters(A,f)}function bBi(o,A,f){o.factory.createExplosion(A,f)}function QBi(o,A,f){o.factory.createFireworks(A,f)}function SBi(o,A,f){o.factory.createSmoke(A,f)}function DBi(o,A,f){o.factory.createFire(A,f)}function MBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function TBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function PBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function RBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function LBi(o,A,f){o.factory.createBillboard(A,f)}function FBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function NBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function kBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function UBi(o,A,f){o.factory.createEllipse(A,f)}function OBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function GBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function HBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function VBi(o,A,f){o.factory.createPolylineVolume(A,f)}function zBi(o,A,f){o.factory.createVideoProjection(A,f)}function YBi(o,A,f){o.factory.createVideoProjection(A,f)}function JBi(o,A,f){o.factory.createTrack(A,f)}function KBi(o,A,f){o.factory.createHeatmap(A,f)}function WBi(o,A,f){o.factory.createEChartLayer(A,f)}function qBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=mBi;yl.parserMap[Xn.IMAGERY_LAYER]=CBi;yl.parserMap[Xn.TERRAIN_LAYER]=EBi;yl.parserMap[Xn.MODEL_LAYER]=IBi;yl.parserMap[Xn.FEATURE_LAYER]=xBi;yl.parserMap[Xn.SKYBOX]=yBi;yl.parserMap[Xn.ENVIRONMENT]=vBi;yl.parserMap[Xn.VIEWPOINT]=_Bi;yl.parserMap[Xn.MODEL]=BBi;yl.parserMap[Xn.WATERS]=wBi;yl.parserMap[Xn.EXPLOSION]=bBi;yl.parserMap[Xn.FIREWORK]=QBi;yl.parserMap[Xn.SMOKE]=SBi;yl.parserMap[Xn.FIRE]=DBi;yl.parserMap[Xn.RADARSCAN]=MBi;yl.parserMap[Xn.CIRCLESCAN]=TBi;yl.parserMap[Xn.POINT]=PBi;yl.parserMap[Xn.LABEL]=RBi;yl.parserMap[Xn.BILLBOARD]=LBi;yl.parserMap[Xn.POLYLINE]=FBi;yl.parserMap[Xn.POLYGON]=NBi;yl.parserMap[Xn.RECTANGLE]=kBi;yl.parserMap[Xn.ELLIPSE]=UBi;yl.parserMap[Xn.BOX]=OBi;yl.parserMap[Xn.ELLIPSOID]=GBi;yl.parserMap[Xn.CYLINDER]=HBi;yl.parserMap[Xn.POLYLINEVOLUME]=VBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=zBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=YBi;yl.parserMap[Xn.TRACK]=JBi;yl.parserMap[Xn.HEATMAP]=KBi;yl.parserMap[Xn.ECHARTLAYER]=WBi;yl.parserMap.ELEMENT=qBi;var htt=yl;var lbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},dtt=lbe;var Abe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},gtt=Abe;var ube=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ube;var cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ptt=cbe;var hbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Lx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},mtt=hbe;var dbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ctt=dbe;var gbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ett=gbe;var fbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Itt=fbe;var pbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},xtt=pbe;var mbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ytt=mbe;var Cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vtt=Cbe;var Ebe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},_tt=Ebe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new R2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new R2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new R2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new uS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new _C({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var Btt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new ytt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ett(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new ptt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Itt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new Btt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new xtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new _tt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new mtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new vtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var Qne=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new oI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new xg;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new oI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new xg;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var yJ=mp;function Tv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Tv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Tv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Tv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Tv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Tv.prototype.addVisualPyramid=function(){let o=this,A=new YO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Tv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Tv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Tv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new B4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Hm=new Z;Tv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Tv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Tv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var Sne=Tv;var Ibe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=jBi(this.coreMap.container)}function xbe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?xbe(o[f],null):A[f];return A}function wtt(o,A){let f=xbe(o),m;for(m in A)f[m]===void 0&&(f[m]=xbe(A[m]));return f}function jBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=wtt(A,{container:o}),new Kh.Toolbar(this,A)};var btt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=wtt(A,btt);let f=new oI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,Ibe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,Ibe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,Ibe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,btt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function XBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function ZBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=ZBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=XBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var Dne=Kh;function Qtt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function $Bi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function ewi(o){if(k(o._pps))return;let A=$Bi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:iwi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function twi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function iwi(o){return`uniform sampler2D colorTexture;
+`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function hBi(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function dBi(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function gBi(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function fBi(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new dBi({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=gBi(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=hBi(x,o),x._model._vertexShaderLoaded=uBi(x,o),x._model._fragmentShaderLoaded=cBi(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function pBi(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;fBi(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Zet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}Xx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};Xx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};Xx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};Xx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};Xx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};Xx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};Xx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};Xx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};Xx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};Xx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var Att=Xx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Gm(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Gm()+Gm()}-${Gm()}-${Gm()}-${Gm()}-${Gm()}${Gm()}${Gm()}`};es.createUUIDWithoutDash=function(){return Gm()+Gm()+Gm()+Gm()+Gm()+Gm()+Gm()+Gm()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new l3;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new une(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new hne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new mD({})};es.prototype.createFeatureLayer=function(o,A){let f=new pne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new gne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new ZO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new Hre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new lY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new wre(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new bet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new bre(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new Qet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new l3(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new Dre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new Tre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new Rre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new Fre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new kre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new ket(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Oet(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new Ine(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=Pet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new zre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new Ore(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new Jre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new Wre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new jre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new Zre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new ine(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new ene(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new nne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new ane(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new lne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new Cne(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Het(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new xne(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new vne(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Wet;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new qet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new jet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new Xet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new Att(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var vb=es;var wne=class extends Kd{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new Bre(A);let m=new l3(A);m.id=vb.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new PP("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(wne.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var bne=wne;function utt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var pFi=new Oa,mFi=new Z,CFi=new Z;utt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;display: none;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var ctt=utt;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=vb.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=vb.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(vb.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&Q6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&Q6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&Q6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&Q6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&Q6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function Q6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function mBi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&Q6(o,A.childNodes,m)}function CBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function EBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function IBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function xBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function yBi(o,A,f){o.coreMap.scene.skyBox=new VN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function vBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function _Bi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function BBi(o,A,f){o.factory.createModel(A,f)}function wBi(o,A,f){o.factory.createWaters(A,f)}function bBi(o,A,f){o.factory.createExplosion(A,f)}function QBi(o,A,f){o.factory.createFireworks(A,f)}function SBi(o,A,f){o.factory.createSmoke(A,f)}function DBi(o,A,f){o.factory.createFire(A,f)}function MBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function TBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function PBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function RBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function LBi(o,A,f){o.factory.createBillboard(A,f)}function FBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function NBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function kBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function UBi(o,A,f){o.factory.createEllipse(A,f)}function OBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function GBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function HBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function VBi(o,A,f){o.factory.createPolylineVolume(A,f)}function zBi(o,A,f){o.factory.createVideoProjection(A,f)}function YBi(o,A,f){o.factory.createVideoProjection(A,f)}function JBi(o,A,f){o.factory.createTrack(A,f)}function KBi(o,A,f){o.factory.createHeatmap(A,f)}function WBi(o,A,f){o.factory.createEChartLayer(A,f)}function qBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=mBi;yl.parserMap[Xn.IMAGERY_LAYER]=CBi;yl.parserMap[Xn.TERRAIN_LAYER]=EBi;yl.parserMap[Xn.MODEL_LAYER]=IBi;yl.parserMap[Xn.FEATURE_LAYER]=xBi;yl.parserMap[Xn.SKYBOX]=yBi;yl.parserMap[Xn.ENVIRONMENT]=vBi;yl.parserMap[Xn.VIEWPOINT]=_Bi;yl.parserMap[Xn.MODEL]=BBi;yl.parserMap[Xn.WATERS]=wBi;yl.parserMap[Xn.EXPLOSION]=bBi;yl.parserMap[Xn.FIREWORK]=QBi;yl.parserMap[Xn.SMOKE]=SBi;yl.parserMap[Xn.FIRE]=DBi;yl.parserMap[Xn.RADARSCAN]=MBi;yl.parserMap[Xn.CIRCLESCAN]=TBi;yl.parserMap[Xn.POINT]=PBi;yl.parserMap[Xn.LABEL]=RBi;yl.parserMap[Xn.BILLBOARD]=LBi;yl.parserMap[Xn.POLYLINE]=FBi;yl.parserMap[Xn.POLYGON]=NBi;yl.parserMap[Xn.RECTANGLE]=kBi;yl.parserMap[Xn.ELLIPSE]=UBi;yl.parserMap[Xn.BOX]=OBi;yl.parserMap[Xn.ELLIPSOID]=GBi;yl.parserMap[Xn.CYLINDER]=HBi;yl.parserMap[Xn.POLYLINEVOLUME]=VBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=zBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=YBi;yl.parserMap[Xn.TRACK]=JBi;yl.parserMap[Xn.HEATMAP]=KBi;yl.parserMap[Xn.ECHARTLAYER]=WBi;yl.parserMap.ELEMENT=qBi;var htt=yl;var lbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},dtt=lbe;var Abe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},gtt=Abe;var ube=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ube;var cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ptt=cbe;var hbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Lx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},mtt=hbe;var dbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ctt=dbe;var gbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ett=gbe;var fbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Itt=fbe;var pbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},xtt=pbe;var mbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ytt=mbe;var Cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vtt=Cbe;var Ebe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},_tt=Ebe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new R2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new R2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new R2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new uS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new _C({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var Btt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new ytt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ett(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new ptt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Itt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new Btt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new xtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new _tt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new mtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new vtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var Qne=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new oI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new xg;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new oI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new xg;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var yJ=mp;function Tv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Tv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Tv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Tv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Tv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Tv.prototype.addVisualPyramid=function(){let o=this,A=new YO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Tv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Tv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Tv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new B4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Hm=new Z;Tv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Hm.x=Q.x*D*R,Hm.y=Q.y*D*P,Hm.z=Q.z*S;let T=EB.changeCartesian3ByScalar(o._position,Hm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Tv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Tv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var Sne=Tv;var Ibe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=jBi(this.coreMap.container)}function xbe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?xbe(o[f],null):A[f];return A}function wtt(o,A){let f=xbe(o),m;for(m in A)f[m]===void 0&&(f[m]=xbe(A[m]));return f}function jBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=wtt(A,{container:o}),new Kh.Toolbar(this,A)};var btt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=wtt(A,btt);let f=new oI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,Ibe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,Ibe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,Ibe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,btt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function XBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function ZBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=ZBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=XBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var Dne=Kh;function Qtt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function $Bi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function ewi(o){if(k(o._pps))return;let A=$Bi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:iwi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function twi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function iwi(o){return`uniform sampler2D colorTexture;
 uniform sampler2D depthTexture;
 in vec2 v_textureCoordinates;
 uniform vec4 u_floodCenterEC;
diff --git a/static/CimSDK/index.cjs b/static/CimSDK/index.cjs
index a1fe536..68396b6 100644
--- a/static/CimSDK/index.cjs
+++ b/static/CimSDK/index.cjs
@@ -21258,7 +21258,7 @@
     if (czm_seWaterHeight > -5000.0 && v_elevationPos.z < czm_seWaterHeight) { discard; }  
     gltf_seWater_main(); 
 } 
-`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function cBi(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function hBi(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function dBi(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function gBi(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new hBi({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=dBi(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=cBi(x,o),x._model._vertexShaderLoaded=ABi(x,o),x._model._fragmentShaderLoaded=uBi(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function fBi(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;gBi(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Xet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}jx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};jx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};jx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};jx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};jx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};jx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};jx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};jx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};jx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};jx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var ltt=jx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Om(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Om()+Om()}-${Om()}-${Om()}-${Om()}-${Om()}${Om()}${Om()}`};es.createUUIDWithoutDash=function(){return Om()+Om()+Om()+Om()+Om()+Om()+Om()+Om()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new s3;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new Ane(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new cne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new pD({})};es.prototype.createFeatureLayer=function(o,A){let f=new fne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new dne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new XO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new Gre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new sY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new Bre(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new wet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new wre(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new bet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new s3(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new Sre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new Mre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new Pre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new Lre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new Nre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new Net(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Uet(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new Ene(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=Tet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new Vre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new Ure(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new Yre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new Kre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new qre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new Xre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new tne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new $re(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new rne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new one(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new sne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new mne(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Get(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new Ine(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new yne(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Ket;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new Wet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new qet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new jet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new ltt(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var yb=es;var Bne=class extends Kd{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new _re(A);let m=new s3(A);m.id=yb.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new TP("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(Bne.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var wne=Bne;function Att(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var dFi=new Oa,gFi=new Z,fFi=new Z;Att.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var utt=Att;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=yb.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=yb.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(yb.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&b6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&b6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&b6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&b6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&b6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function b6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function pBi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&b6(o,A.childNodes,m)}function mBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function CBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function EBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function IBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function xBi(o,A,f){o.coreMap.scene.skyBox=new HN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function yBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function vBi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function _Bi(o,A,f){o.factory.createModel(A,f)}function BBi(o,A,f){o.factory.createWaters(A,f)}function wBi(o,A,f){o.factory.createExplosion(A,f)}function bBi(o,A,f){o.factory.createFireworks(A,f)}function QBi(o,A,f){o.factory.createSmoke(A,f)}function SBi(o,A,f){o.factory.createFire(A,f)}function DBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function MBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function TBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function PBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function RBi(o,A,f){o.factory.createBillboard(A,f)}function LBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function FBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function NBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function kBi(o,A,f){o.factory.createEllipse(A,f)}function UBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function OBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function GBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function HBi(o,A,f){o.factory.createPolylineVolume(A,f)}function VBi(o,A,f){o.factory.createVideoProjection(A,f)}function zBi(o,A,f){o.factory.createVideoProjection(A,f)}function YBi(o,A,f){o.factory.createTrack(A,f)}function JBi(o,A,f){o.factory.createHeatmap(A,f)}function KBi(o,A,f){o.factory.createEChartLayer(A,f)}function WBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=pBi;yl.parserMap[Xn.IMAGERY_LAYER]=mBi;yl.parserMap[Xn.TERRAIN_LAYER]=CBi;yl.parserMap[Xn.MODEL_LAYER]=EBi;yl.parserMap[Xn.FEATURE_LAYER]=IBi;yl.parserMap[Xn.SKYBOX]=xBi;yl.parserMap[Xn.ENVIRONMENT]=yBi;yl.parserMap[Xn.VIEWPOINT]=vBi;yl.parserMap[Xn.MODEL]=_Bi;yl.parserMap[Xn.WATERS]=BBi;yl.parserMap[Xn.EXPLOSION]=wBi;yl.parserMap[Xn.FIREWORK]=bBi;yl.parserMap[Xn.SMOKE]=QBi;yl.parserMap[Xn.FIRE]=SBi;yl.parserMap[Xn.RADARSCAN]=DBi;yl.parserMap[Xn.CIRCLESCAN]=MBi;yl.parserMap[Xn.POINT]=TBi;yl.parserMap[Xn.LABEL]=PBi;yl.parserMap[Xn.BILLBOARD]=RBi;yl.parserMap[Xn.POLYLINE]=LBi;yl.parserMap[Xn.POLYGON]=FBi;yl.parserMap[Xn.RECTANGLE]=NBi;yl.parserMap[Xn.ELLIPSE]=kBi;yl.parserMap[Xn.BOX]=UBi;yl.parserMap[Xn.ELLIPSOID]=OBi;yl.parserMap[Xn.CYLINDER]=GBi;yl.parserMap[Xn.POLYLINEVOLUME]=HBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=VBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=zBi;yl.parserMap[Xn.TRACK]=YBi;yl.parserMap[Xn.HEATMAP]=JBi;yl.parserMap[Xn.ECHARTLAYER]=KBi;yl.parserMap.ELEMENT=WBi;var ctt=yl;var sbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},htt=sbe;var lbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},dtt=lbe;var Abe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},gtt=Abe;var ube=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ube;var cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Rx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ptt=cbe;var hbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},mtt=hbe;var dbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ctt=dbe;var gbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ett=gbe;var fbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},Itt=fbe;var pbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},xtt=pbe;var mbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ytt=mbe;var Cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vtt=Cbe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new P2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new P2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new P2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new AS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new vC({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var _tt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new xtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new mtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ett(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new _tt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new htt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Itt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new vtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new ptt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new ytt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var bne=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new nI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new xg;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new nI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new xg;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var xJ=mp;function Mv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Mv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Mv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Mv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Mv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Mv.prototype.addVisualPyramid=function(){let o=this,A=new zO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Mv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Mv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Mv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new _4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Gm=new Z;Mv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Mv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Mv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var Qne=Mv;var Ebe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=qBi(this.coreMap.container)}function Ibe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?Ibe(o[f],null):A[f];return A}function Btt(o,A){let f=Ibe(o),m;for(m in A)f[m]===void 0&&(f[m]=Ibe(A[m]));return f}function qBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=Btt(A,{container:o}),new Kh.Toolbar(this,A)};var wtt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Btt(A,wtt);let f=new nI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,Ebe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,Ebe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,Ebe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,wtt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function jBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function XBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=XBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=jBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var Sne=Kh;function btt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function ZBi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function $Bi(o){if(k(o._pps))return;let A=ZBi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:twi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function ewi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function twi(o){return`uniform sampler2D colorTexture;
+`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function cBi(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function hBi(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function dBi(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function gBi(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new hBi({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=dBi(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=cBi(x,o),x._model._vertexShaderLoaded=ABi(x,o),x._model._fragmentShaderLoaded=uBi(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function fBi(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;gBi(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Xet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}jx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};jx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};jx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};jx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};jx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};jx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};jx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};jx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};jx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};jx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var ltt=jx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Om(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Om()+Om()}-${Om()}-${Om()}-${Om()}-${Om()}${Om()}${Om()}`};es.createUUIDWithoutDash=function(){return Om()+Om()+Om()+Om()+Om()+Om()+Om()+Om()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new s3;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new Ane(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new cne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new pD({})};es.prototype.createFeatureLayer=function(o,A){let f=new fne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new dne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new XO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new Gre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new sY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new Bre(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new wet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new wre(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new bet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new s3(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new Sre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new Mre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new Pre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new Lre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new Nre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new Net(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Uet(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new Ene(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=Tet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new Vre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new Ure(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new Yre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new Kre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new qre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new Xre(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new tne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new $re(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new rne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new one(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new sne(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new mne(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Get(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new Ine(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new yne(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Ket;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new Wet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new qet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new jet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new ltt(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var yb=es;var Bne=class extends Kd{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new _re(A);let m=new s3(A);m.id=yb.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new TP("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(Bne.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var wne=Bne;function Att(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var dFi=new Oa,gFi=new Z,fFi=new Z;Att.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;display: none;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var utt=Att;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=yb.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=yb.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(yb.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&b6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&b6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&b6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&b6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&b6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function b6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function pBi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&b6(o,A.childNodes,m)}function mBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function CBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function EBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function IBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function xBi(o,A,f){o.coreMap.scene.skyBox=new HN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function yBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function vBi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function _Bi(o,A,f){o.factory.createModel(A,f)}function BBi(o,A,f){o.factory.createWaters(A,f)}function wBi(o,A,f){o.factory.createExplosion(A,f)}function bBi(o,A,f){o.factory.createFireworks(A,f)}function QBi(o,A,f){o.factory.createSmoke(A,f)}function SBi(o,A,f){o.factory.createFire(A,f)}function DBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function MBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function TBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function PBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function RBi(o,A,f){o.factory.createBillboard(A,f)}function LBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function FBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function NBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function kBi(o,A,f){o.factory.createEllipse(A,f)}function UBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function OBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function GBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function HBi(o,A,f){o.factory.createPolylineVolume(A,f)}function VBi(o,A,f){o.factory.createVideoProjection(A,f)}function zBi(o,A,f){o.factory.createVideoProjection(A,f)}function YBi(o,A,f){o.factory.createTrack(A,f)}function JBi(o,A,f){o.factory.createHeatmap(A,f)}function KBi(o,A,f){o.factory.createEChartLayer(A,f)}function WBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=pBi;yl.parserMap[Xn.IMAGERY_LAYER]=mBi;yl.parserMap[Xn.TERRAIN_LAYER]=CBi;yl.parserMap[Xn.MODEL_LAYER]=EBi;yl.parserMap[Xn.FEATURE_LAYER]=IBi;yl.parserMap[Xn.SKYBOX]=xBi;yl.parserMap[Xn.ENVIRONMENT]=yBi;yl.parserMap[Xn.VIEWPOINT]=vBi;yl.parserMap[Xn.MODEL]=_Bi;yl.parserMap[Xn.WATERS]=BBi;yl.parserMap[Xn.EXPLOSION]=wBi;yl.parserMap[Xn.FIREWORK]=bBi;yl.parserMap[Xn.SMOKE]=QBi;yl.parserMap[Xn.FIRE]=SBi;yl.parserMap[Xn.RADARSCAN]=DBi;yl.parserMap[Xn.CIRCLESCAN]=MBi;yl.parserMap[Xn.POINT]=TBi;yl.parserMap[Xn.LABEL]=PBi;yl.parserMap[Xn.BILLBOARD]=RBi;yl.parserMap[Xn.POLYLINE]=LBi;yl.parserMap[Xn.POLYGON]=FBi;yl.parserMap[Xn.RECTANGLE]=NBi;yl.parserMap[Xn.ELLIPSE]=kBi;yl.parserMap[Xn.BOX]=UBi;yl.parserMap[Xn.ELLIPSOID]=OBi;yl.parserMap[Xn.CYLINDER]=GBi;yl.parserMap[Xn.POLYLINEVOLUME]=HBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=VBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=zBi;yl.parserMap[Xn.TRACK]=YBi;yl.parserMap[Xn.HEATMAP]=JBi;yl.parserMap[Xn.ECHARTLAYER]=KBi;yl.parserMap.ELEMENT=WBi;var ctt=yl;var sbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},htt=sbe;var lbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},dtt=lbe;var Abe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},gtt=Abe;var ube=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ube;var cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Rx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ptt=cbe;var hbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},mtt=hbe;var dbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Ctt=dbe;var gbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ett=gbe;var fbe=class extends _a{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},Itt=fbe;var pbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},xtt=pbe;var mbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ytt=mbe;var Cbe=class extends _a{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},vtt=Cbe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new P2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new P2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new P2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new AS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new vC({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var _tt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new xtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new mtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ett(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new _tt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new htt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Itt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new vtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new ptt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new ytt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var bne=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new nI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new xg;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new nI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new xg;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var xJ=mp;function Mv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Mv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Mv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Mv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Mv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Mv.prototype.addVisualPyramid=function(){let o=this,A=new zO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Mv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Mv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Mv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new _4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Gm=new Z;Mv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=CB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Mv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Mv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var Qne=Mv;var Ebe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=qBi(this.coreMap.container)}function Ibe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?Ibe(o[f],null):A[f];return A}function Btt(o,A){let f=Ibe(o),m;for(m in A)f[m]===void 0&&(f[m]=Ibe(A[m]));return f}function qBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=Btt(A,{container:o}),new Kh.Toolbar(this,A)};var wtt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Btt(A,wtt);let f=new nI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,Ebe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,Ebe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,Ebe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,wtt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function jBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function XBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=XBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=jBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var Sne=Kh;function btt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function ZBi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function $Bi(o){if(k(o._pps))return;let A=ZBi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:twi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function ewi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function twi(o){return`uniform sampler2D colorTexture;
 uniform sampler2D depthTexture;
 in vec2 v_textureCoordinates;
 uniform vec4 u_floodCenterEC;
diff --git a/static/CimSDK/index.js b/static/CimSDK/index.js
index 40a7982..ad5f3fd 100644
--- a/static/CimSDK/index.js
+++ b/static/CimSDK/index.js
@@ -21258,7 +21258,7 @@
     if (czm_seWaterHeight > -5000.0 && v_elevationPos.z < czm_seWaterHeight) { discard; }  
     gltf_seWater_main(); 
 } 
-`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function W_i(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function q_i(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function j_i(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function X_i(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new q_i({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=j_i(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=W_i(x,o),x._model._vertexShaderLoaded=J_i(x,o),x._model._fragmentShaderLoaded=K_i(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function Z_i(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;X_i(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Vet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}jx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};jx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};jx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};jx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};jx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};jx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};jx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};jx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};jx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};jx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var ett=jx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Om(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Om()+Om()}-${Om()}-${Om()}-${Om()}-${Om()}${Om()}${Om()}`};es.createUUIDWithoutDash=function(){return Om()+Om()+Om()+Om()+Om()+Om()+Om()+Om()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new C6;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new L1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new F1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new pD({})};es.prototype.createFeatureLayer=function(o,A){let f=new k1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new N1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new XO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new _1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new oY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new p1e(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new Cet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new m1e(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new Eet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new C6(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new C1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new E1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new I1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new x1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new y1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new Qet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Met(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new O1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=vet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new B1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new v1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new w1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new b1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new Q1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new S1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new M1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new D1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new T1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new P1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new R1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new U1e(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Pet(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new H1e(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new V1e(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Uet;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new Oet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new Get(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new Het(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new ett(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var LD=es;var Qre=class extends xg{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new g1e(A);let m=new C6(A);m.id=LD.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new s3("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(Qre.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var z1e=Qre;function ttt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var dFi=new Oa,gFi=new Z,fFi=new Z;ttt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var itt=ttt;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=LD.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=LD.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(LD.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&w6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&w6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&w6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&w6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&w6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function w6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function $_i(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&w6(o,A.childNodes,m)}function eBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function tBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function iBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function rBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function nBi(o,A,f){o.coreMap.scene.skyBox=new HN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function oBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function aBi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function sBi(o,A,f){o.factory.createModel(A,f)}function lBi(o,A,f){o.factory.createWaters(A,f)}function ABi(o,A,f){o.factory.createExplosion(A,f)}function uBi(o,A,f){o.factory.createFireworks(A,f)}function cBi(o,A,f){o.factory.createSmoke(A,f)}function hBi(o,A,f){o.factory.createFire(A,f)}function dBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function gBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function fBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function pBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function mBi(o,A,f){o.factory.createBillboard(A,f)}function CBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function EBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function IBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function xBi(o,A,f){o.factory.createEllipse(A,f)}function yBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function vBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function _Bi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function BBi(o,A,f){o.factory.createPolylineVolume(A,f)}function wBi(o,A,f){o.factory.createVideoProjection(A,f)}function bBi(o,A,f){o.factory.createVideoProjection(A,f)}function QBi(o,A,f){o.factory.createTrack(A,f)}function SBi(o,A,f){o.factory.createHeatmap(A,f)}function DBi(o,A,f){o.factory.createEChartLayer(A,f)}function MBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=$_i;yl.parserMap[Xn.IMAGERY_LAYER]=eBi;yl.parserMap[Xn.TERRAIN_LAYER]=tBi;yl.parserMap[Xn.MODEL_LAYER]=iBi;yl.parserMap[Xn.FEATURE_LAYER]=rBi;yl.parserMap[Xn.SKYBOX]=nBi;yl.parserMap[Xn.ENVIRONMENT]=oBi;yl.parserMap[Xn.VIEWPOINT]=aBi;yl.parserMap[Xn.MODEL]=sBi;yl.parserMap[Xn.WATERS]=lBi;yl.parserMap[Xn.EXPLOSION]=ABi;yl.parserMap[Xn.FIREWORK]=uBi;yl.parserMap[Xn.SMOKE]=cBi;yl.parserMap[Xn.FIRE]=hBi;yl.parserMap[Xn.RADARSCAN]=dBi;yl.parserMap[Xn.CIRCLESCAN]=gBi;yl.parserMap[Xn.POINT]=fBi;yl.parserMap[Xn.LABEL]=pBi;yl.parserMap[Xn.BILLBOARD]=mBi;yl.parserMap[Xn.POLYLINE]=CBi;yl.parserMap[Xn.POLYGON]=EBi;yl.parserMap[Xn.RECTANGLE]=IBi;yl.parserMap[Xn.ELLIPSE]=xBi;yl.parserMap[Xn.BOX]=yBi;yl.parserMap[Xn.ELLIPSOID]=vBi;yl.parserMap[Xn.CYLINDER]=_Bi;yl.parserMap[Xn.POLYLINEVOLUME]=BBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=wBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=bBi;yl.parserMap[Xn.TRACK]=QBi;yl.parserMap[Xn.HEATMAP]=SBi;yl.parserMap[Xn.ECHARTLAYER]=DBi;yl.parserMap.ELEMENT=MBi;var rtt=yl;var Y1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},ntt=Y1e;var J1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},ott=J1e;var K1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},att=K1e;var W1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},stt=W1e;var q1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Rx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ltt=q1e;var j1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Att=j1e;var X1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},utt=X1e;var Z1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},ctt=Z1e;var $1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},htt=$1e;var ebe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},dtt=ebe;var tbe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},gtt=tbe;var ibe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ibe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new R2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new R2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new R2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new AS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new vC({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var ptt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new ott(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new utt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new att(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new Att(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new stt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new ptt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new ntt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new htt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new ltt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var rbe=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new nI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new Ig;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new nI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new Ig;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var IJ=mp;function Tv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Tv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Tv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Tv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Tv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Tv.prototype.addVisualPyramid=function(){let o=this,A=new zO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Tv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Tv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Tv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new _4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Gm=new Z;Tv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Tv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Tv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var nbe=Tv;var obe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=TBi(this.coreMap.container)}function abe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?abe(o[f],null):A[f];return A}function mtt(o,A){let f=abe(o),m;for(m in A)f[m]===void 0&&(f[m]=abe(A[m]));return f}function TBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=mtt(A,{container:o}),new Kh.Toolbar(this,A)};var Ctt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=mtt(A,Ctt);let f=new nI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,obe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,obe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,obe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,Ctt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function PBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function RBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=RBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=PBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var sbe=Kh;function Ett(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function LBi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function FBi(o){if(k(o._pps))return;let A=LBi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:kBi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function NBi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function kBi(o){return`uniform sampler2D colorTexture;
+`;let x=C.getFragmentShaderCallback(E,o._diffuseAttributeOrUniformName[m],!1);return A.defined(x)?x(f):f}}function W_i(o,A){let f=o._batchTable;return o._batchTable.featuresLength===0?function(m){let C={u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),E&&E.model?(I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix):A.Matrix4.IDENTITY}};return A.combine(m,C)}:function(m){let C={tile_batchTexture:function(){return defaultValue(f._batchTexture.batchTexture,f._batchTexture.defaultTexture)},tile_textureDimensions:function(){return f._batchTexture.textureDimensions},tile_textureStep:function(){return f._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(f)},tile_pickTexture:function(){return f._batchTexture.pickTexture},u_inverseElevationMatrix:function(E){let I=o._model,x=typeof I._elevationMatrix;if(x==="undefined")return A.Matrix4.IDENTITY;if(x==="function"?I._uniformInverseElevationMatrix=I._elevationMatrix(I._uniformInverseElevationMatrix):A.Matrix4.clone(I._elevationMatrix,I._uniformInverseElevationMatrix),A.Matrix4.inverse(I._uniformInverseElevationMatrix,I._uniformInverseElevationMatrix),I._rtcCenter){let y=new A.Matrix4,v=A.Matrix4.fromTranslation(I._rtcCenter,y);A.Matrix4.multiply(I._uniformInverseElevationMatrix,v,I._uniformInverseElevationMatrix)}return I._uniformInverseElevationModelMatrix||(I._uniformInverseElevationModelMatrix=new A.Matrix4),I._uniformInverseElevationModelMatrix=A.Matrix4.multiply(I._uniformInverseElevationMatrix,E.model,I._uniformInverseElevationModelMatrix),I._uniformInverseElevationModelMatrix}};return A.combine(m,C)}}function q_i(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function j_i(o,A,f){try{let m=f.Ellipsoid.WGS84,C=m.scaleToGeodeticSurface(o);return A=f.Transforms.eastNorthUpToFixedFrame(C,m,A),A}catch{return f.Matrix4.clone(f.Matrix4.IDENTITY,A)}}function X_i(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new q_i({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(f){return f.seWaterHeight?f.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var A=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(f){A.call(this,f),this.show&&this.ready&&(this._autoElevationMatrix=j_i(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(f,m,C,E,I){if(f.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(f,m,C,E,I);let x=new o.Batched3DModel3DTileContent(f,m,C,E,I);return x._model instanceof o.ClassificationModel||(x._model._elevationMatrix=function(y){let v=f._elevationMatrix||f._autoElevationMatrix||o.Matrix4.IDENTITY;return y=o.Matrix4.clone(v,y),y},x._model._uniformMapLoaded=W_i(x,o),x._model._vertexShaderLoaded=J_i(x,o),x._model._fragmentShaderLoaded=K_i(x,o)),x},o.ShaderProgram.prototype._setUniforms=function(f,m,C){let E,I;if(o.defined(f)){let v=this._manualUniforms;for(E=v.length,I=0;I<E;++I){let w=v[I];w.value=f[w.name](m)}}let x=this._automaticUniforms;for(E=x.length,I=0;I<E;++I){let v=x[I];v.uniform.value=v.automaticUniform.getValue(m)}let y=this._uniforms;for(E=y.length,I=0;I<E;++I)y[I].set();if(C){let v=this._gl,w=this._program;v.validateProgram(w)}}}function Z_i(o,A){let f=o.baseWaterColor||new A.Color(.2,.3,.6,1),m=o.blendColor||new A.Color(.5,.5,.5,.7),C=o.animationSpeed||.05,E=o.amplitude||2,I=o.frequency||5e3,x=o.specularIntensity||.5,y=o.fadeFactor||1,v=o.sizeAndVelocity||new A.Cartesian4(100,100,10,0),w=o.width||316,Q=o.height||316;X_i(A),A.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:f,blendColor:m,specularMap:A.Material.DefaultImageId,normalMap:A.Material.DefaultImageId,frequency:I,animationSpeed:C,amplitude:E,specularIntensity:x,fadeFactor:y,sizeAndVelocity:v},source:Vet},translucent:function(M){var B=M.uniforms;return B.baseWaterColor.alpha<1||B.blendColor.alpha<1}})}jx.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),A=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));A.material=o,this._debugViewportQuad=this._scene.primitives.add(A);let f=this._getWaterReflectTexture();f&&(o.uniforms.image=f)};jx.prototype.debugShow=function(o){this._debugViewportQuad.show=o};jx.prototype.isDebugShow=function(){return this._debugViewportQuad.show};jx.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};jx.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};jx.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let A=this;return o._uniforms.specularMap_0=function(){return A._wTexture._colorTexture||A._scene.context.defaultTexture},o};jx.prototype.createWaterPolygonPrimitive=function(o){let A=this,f=this._scene,m=null,C=null;if(o.type==0)m=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),C.appearance.material=this._createWaterMaterial();else if(o.type==1)m=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),C=f.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:m}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),C.appearance.material=this._createWaterMaterial();else if(o.type==2){let I=new this._cesium.GeometryInstance({geometry:o.geometry});C=f.primitives.add(new this._cesium.Primitive({geometryInstances:I,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}C.appearance.material.uniforms.sizeAndVelocity.x=o.width,C.appearance.material.uniforms.sizeAndVelocity.y=o.height,C.radius=.5*Math.max(o.width,o.height),C.centerPos=o.center;let E=this._cesium.Cartographic.fromCartesian(o.center);return C.waterHeight=E.height,this._trackPrimitive(C),C};jx.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};jx.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};jx.prototype._untrackPrimitive=function(o){let A=this._trackedPrimitives.indexOf(o);A!=-1&&this._trackedPrimitives.splice(A,1)};jx.prototype.isDestroyed=function(){return!1};jx.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var ett=jx;function es(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Om(){return((1+De.nextRandomNumber())*65536|0).toString(16).substring(1)}es.createUUID=function(){return`${Om()+Om()}-${Om()}-${Om()}-${Om()}-${Om()}${Om()}${Om()}`};es.createUUIDWithoutDash=function(){return Om()+Om()+Om()+Om()+Om()+Om()+Om()+Om()};es.prototype.createUUID=function(){return es.createUUID()};es.prototype.createGroup=function(o){let A=new C6;return A.id=o.id||es.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};es.prototype.createImageryLayer=function(o,A){let f=new L1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.IMAGERYPROVIDERS),f),f};es.prototype.createTerrainLayer=function(o,A){let f=new F1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.TERRAINPROVIDERS),f),f};es.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new pD({})};es.prototype.createFeatureLayer=function(o,A){let f=new k1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.FEATURELAYERS),f),f};es.prototype.createModelLayer=function(o,A){let f=new N1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createWfsModel=function(o,A){let f=new XO(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.MODELLAYERS),f),f};es.prototype.createModel=function(o,A){let f=new _1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.removeModel=function(o){k(o)&&o.removeFromMap()};es.prototype.createCZMLObject=function(o,A){let f=this,m=ae(o.addToMap,!0),C=new oY(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),C),C};es.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,k(o.name)&&(A.name=o.name),k(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};es.prototype.removeElement=function(o){k(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};es.prototype.createVideoProjection=function(o,A){o.addToMap=ae(o.addToMap,!0);let f=ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new p1e(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="panorama"?(m=new Cet(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)):f==="fisheye"&&(m=new m1e(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),m)),m};es.prototype.createTrack=function(o,A){let f=new Eet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSceneNode=function(o,A,f){let m=new C6(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};es.prototype.createFire=function(o,A){let f=new C1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createSmoke=function(o,A){let f=new E1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createExplosion=function(o,A){let f=new I1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createFireworks=function(o,A){let f=new x1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRadarScan=function(o,A){let f=new y1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCircleScan=function(o,A){let f=new Qet(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createUpDownScan=function(o){let A=new Met(this._earthCtrl,o);return A.show=!0,A};es.prototype.createWaters=function(o,A){let f=new O1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createHeatmap=function(o,A){let f=vet.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createLabel=function(o,A){let f=new B1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBillboard=function(o,A){let f=new v1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolyline=function(o,A){let f=new w1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolygon=function(o,A){let f=new b1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPoint=function(o,A){let f=new Q1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createBox=function(o,A){let f=new S1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipsoid=function(o,A){let f=new M1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createCylinder=function(o,A){let f=new D1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createRectangle=function(o,A){let f=new T1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEllipse=function(o,A){let f=new P1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPolylineVolume=function(o,A){let f=new R1e(this._earthCtrl,o);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createEChartLayer=function(o,A){let f=new U1e(this._earthCtrl);return f.name=o.name,f.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(ds.USERSCENE),f),f};es.prototype.createPointLight=function(o){return new Pet(this._earthCtrl,o)};es.prototype.createHawkeye=function(o){let A=new H1e(this._earthCtrl,o);A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),ae(o.addToMap,!0)&&A.addToMap(o)};es.prototype.createSpotLight=function(o){let A=new V1e(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderManager=function(o){let A=new Uet;return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createCustomShaderStage=function(o){let A=new Oet(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createModelOutline=function(o={}){let A=new Get(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.modelClick=function(o={}){let A=new Het(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A};es.prototype.createWaterPolygon=function(o){let A=new ett(this._earthCtrl,o);return A.name=ae(o.name,null),A.id=ae(o.id,this._earthCtrl.factory.createUUID()),A.createWaterPolygonPrimitive(o)};var LD=es;var Qre=class extends xg{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new g1e(A);let m=new C6(A);m.id=LD.createUUID(),m.name=ae(f.ProjectName,"root"),m.version=ae(f.version,null),m.desc=ae(f.desc,null),m.createTime=ae(f.createTime,new Date().toISOString()),m.lastUpdate=ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new s3("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];k(f)&&this.removeChild(f)}removeChild(A){k(A)&&k(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){k(A)&&k(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);k(m)&&k(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let E=0;E<m.parentNode.childNodes.length;E++)m.parentNode.childNodes[E].id===m.id&&(C=E);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=De.clamp(f,0,A.length-1),m=De.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,E){let I={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},x=0,y=[];for(let v in I){let w=I[v],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let D=Q.childNodes[B].toJSON();M.push(D)}Promise.all(M).then(function(B){let D=[];if(B.length!==0){for(let R=0;R<B.length;R++)D.push(B[R]);let S=D[0].class;S!=="IMAGERY_LAYER"&&S!=="TERRAIN_LAYER"&&S!=="MODEL_LAYER"&&S!=="FEATURE_LAYER"&&(S="USER_SCENE");let P={item:S,objJson:D};y.push(P)}x++,x===5&&(C(y),x=0)})}}).then(function(C){let E={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(E.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(E.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(E.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(E.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(E.userScene=C[w].objJson);let I={class:"ENVIRONMENT",underGround:ae(f._earthCtrl.camera.undergroundMode,null),shadow:ae(f._earthCtrl.shadows,null),depthTest:ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:ae(f._earthCtrl.environment.rain.show,null),snow:ae(f._earthCtrl.environment.snow.show,null),fog:ae(f._earthCtrl.environment.fog.show,null),bwMode:ae(f._earthCtrl.environment.bwMode.show,null),nightMode:ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},x={class:"SKYBOX",positiveX:ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},y={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};E.userScene.push(I),E.userScene.push(x),E.userScene.push(y);let v=JSON.stringify(E);A&&A(v)})}};Object.defineProperties(Qre.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var z1e=Qre;function ttt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var dFi=new Oa,gFi=new Z,fFi=new Z;ttt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;display: none;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let E=document.createElement("div");E.style=f,o.appendChild(E);let I=A.scene.canvas,x=A.scene.globe.ellipsoid;new pr(I).setInputAction(function(v){let w=A.camera.pickEllipsoid(v.endPosition,x);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=De.toDegrees(Q.latitude).toFixed(6),B=De.toDegrees(Q.longitude).toFixed(6),D=A.camera.positionCartographic.height.toFixed(1);E.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${D}\u7C73`}},_i.MOUSE_MOVE)};var itt=ttt;function yl(){}yl.parseBaseData=function(o,A){let f=[];if(k(A)&&k(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let E=A.imageryProviders[C];if(E.enable===!1||E.show===!1)continue;if(k(E.tilingScheme)){let x=E.tilingScheme;x.type==="GeographicTilingScheme"&&(E.tilingScheme=new ph(x))}let I=LD.createImageryLayer(E);f.push(I)}let m=[];if(k(A)&&k(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let E=A.terrainProviders[C];if(E.enable===!1||E.show===!1)continue;let I=LD.createTerrainLayer(E);m.push(I)}return{imageryProvider:f,terrainProvider:m}};yl.parse=function(o,A){if(!k(A))return;let f=[ds.IMAGERYPROVIDERS,ds.TERRAINPROVIDERS,ds.MODELLAYERS,ds.FEATURELAYERS,ds.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(LD.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}k(A[ds.IMAGERYPROVIDERS])&&w6(o,A[ds.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),k(A[ds.TERRAINPROVIDERS])&&w6(o,A[ds.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),k(A[ds.MODELLAYERS])&&w6(o,A[ds.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),k(A[ds.FEATURELAYERS])&&w6(o,A[ds.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),k(A[ds.USERSCENE])&&w6(o,A[ds.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function w6(o,A,f,m){for(let C=0;C<A.length;C++){let E=A[C],I=null;if(E.enable===!1)continue;k(E.class)?(E.class==="IMAGERY"&&(E.class=Xn.IMAGERY_LAYER),E.class==="TERRAIN"&&(E.class=Xn.TERRAIN_LAYER),I=E.class):(m===0?E.class=Xn.IMAGERY_LAYER:m===1&&(E.class=Xn.TERRAIN_LAYER),I=E.class);let x=yl.parserMap[I];x!==void 0&&x(o,E,f)}}function $_i(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=ae(A.show,!0),o.userScene.addChild(f,m),k(A.childNodes)&&w6(o,A.childNodes,m)}function eBi(o,A,f){let m=A;if(k(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new ph(C))}o.factory.createImageryLayer(m,f)}function tBi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function iBi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function rBi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function nBi(o,A,f){o.coreMap.scene.skyBox=new HN({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function oBi(o,A,f){o.camera.undergroundMode=ae(A.underGround,!1),o.shadows=ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function aBi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function sBi(o,A,f){o.factory.createModel(A,f)}function lBi(o,A,f){o.factory.createWaters(A,f)}function ABi(o,A,f){o.factory.createExplosion(A,f)}function uBi(o,A,f){o.factory.createFireworks(A,f)}function cBi(o,A,f){o.factory.createSmoke(A,f)}function hBi(o,A,f){o.factory.createFire(A,f)}function dBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function gBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function fBi(o,A,f){A.color&&(A.color=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function pBi(o,A,f){A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function mBi(o,A,f){o.factory.createBillboard(A,f)}function CBi(o,A,f){A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new qe(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function EBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=yl.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function IBi(o,A,f){A.coordinates&&(A.coordinates=hi.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new qe(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function xBi(o,A,f){o.factory.createEllipse(A,f)}function yBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new Z(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function vBi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new Z(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function _Bi(o,A,f){A.material&&(A.material=new qe(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new qe(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=Z.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function BBi(o,A,f){o.factory.createPolylineVolume(A,f)}function wBi(o,A,f){o.factory.createVideoProjection(A,f)}function bBi(o,A,f){o.factory.createVideoProjection(A,f)}function QBi(o,A,f){o.factory.createTrack(A,f)}function SBi(o,A,f){o.factory.createHeatmap(A,f)}function DBi(o,A,f){o.factory.createEChartLayer(A,f)}function MBi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}yl.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=Z.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};yl.parserMap={};yl.parserMap[Xn.NODE]=$_i;yl.parserMap[Xn.IMAGERY_LAYER]=eBi;yl.parserMap[Xn.TERRAIN_LAYER]=tBi;yl.parserMap[Xn.MODEL_LAYER]=iBi;yl.parserMap[Xn.FEATURE_LAYER]=rBi;yl.parserMap[Xn.SKYBOX]=nBi;yl.parserMap[Xn.ENVIRONMENT]=oBi;yl.parserMap[Xn.VIEWPOINT]=aBi;yl.parserMap[Xn.MODEL]=sBi;yl.parserMap[Xn.WATERS]=lBi;yl.parserMap[Xn.EXPLOSION]=ABi;yl.parserMap[Xn.FIREWORK]=uBi;yl.parserMap[Xn.SMOKE]=cBi;yl.parserMap[Xn.FIRE]=hBi;yl.parserMap[Xn.RADARSCAN]=dBi;yl.parserMap[Xn.CIRCLESCAN]=gBi;yl.parserMap[Xn.POINT]=fBi;yl.parserMap[Xn.LABEL]=pBi;yl.parserMap[Xn.BILLBOARD]=mBi;yl.parserMap[Xn.POLYLINE]=CBi;yl.parserMap[Xn.POLYGON]=EBi;yl.parserMap[Xn.RECTANGLE]=IBi;yl.parserMap[Xn.ELLIPSE]=xBi;yl.parserMap[Xn.BOX]=yBi;yl.parserMap[Xn.ELLIPSOID]=vBi;yl.parserMap[Xn.CYLINDER]=_Bi;yl.parserMap[Xn.POLYLINEVOLUME]=BBi;yl.parserMap[Xn.PERSPECTIVE_VIDEO_PROJECTION]=wBi;yl.parserMap[Xn.FISHEYE_VIDEO_PROJECTION]=bBi;yl.parserMap[Xn.TRACK]=QBi;yl.parserMap[Xn.HEATMAP]=SBi;yl.parserMap[Xn.ECHARTLAYER]=DBi;yl.parserMap.ELEMENT=MBi;var rtt=yl;var Y1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,k(this.editBillboard)&&k(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(k(A)&&k(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:k(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},ntt=Y1e;var J1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,k(this.editPoint)&&k(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(k(A)&&k(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:k(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},ott=J1e;var K1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,k(this.editBox)&&k(this.editBox.entity.box)){let E=this.editBox.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z;this.getNorthPointByDistance(x,y),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:x,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:y,point:{heightReference:this.editBox.entity.box.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),k(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let E=Vr.eastNorthUpToFixedFrame(C),I=new Z,x=this.editBox.entity.box.dimensions._value;x||(x=this.editBox.entity.box.dimensions.getValue(m)),Z.divideByScalar(x,2,I),Z.clone(I,A),Z.clone(I,f),A.y*=-1,Re.multiplyByPoint(E,A,A),f.y*=-1,f.z*=-1,Re.multiplyByPoint(E,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=jt.fromDate(f);if(k(this.currentPoint)||k(this.pickEditHeightPoint)||k(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,E=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!E)return;let I=Lt.fromCartesian(E),x=Z.fromRadians(I.longitude,I.latitude,I.height+this.height);if(k(this.currentPoint))this.currentPoint.position=x,this.editBox.entity.position=new Kr(function(){return x},!1);else if(k(this.dragPosition)){if(k(this.pickEditWHPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=Z.normalize(w,new Z);Z.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=Z.clone(M);B.x-=w.x,B.y+=w.y,Z.abs(B,B),this.editBox.entity.box.dimensions=new Kr(function(){return B},!1)}else if(k(this.pickEditHeightPoint)){let w=Z.subtract(E,this.dragPosition,new Z),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=Z.clone(Q);M.z+=w.z,Z.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=E;let y=new Z,v=new Z;this.getNorthPointByDistance(y,v,m),this.editHeightPoint.position=y,this.editWHPoint.position=v}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(k(A)&&k(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:k(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},att=K1e;var W1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,k(this.editCylinder)&&k(this.editCylinder.entity.cylinder)){let E=this.editCylinder.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value,v=new Z,w=new Z,Q=new Z;this.getNorthPointByDistance(v,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),x>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:v,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),y>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:qe.RED,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editCylinder.entity.cylinder.length._value,x=this.editCylinder.entity.cylinder.topRadius._value,y=this.editCylinder.entity.cylinder.bottomRadius._value;x>0&&(A.z+=I/2,A.x+=x,Re.multiplyByPoint(E,A,A)),y>0&&(f.x+=y,f.z-=I/2,Re.multiplyByPoint(E,f,f)),m.z+=I/2,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.heightPoint)||k(this.topRadiusPoint)||k(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editCylinder.entity.position=E;else if(k(this.dragPosition)){if(k(this.pickHeightPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(k(this.pickTopRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(k(this.pickBottomRadiusPoint)){let Q=Z.subtract(m,this.dragPosition,new Z),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let I=this.editCylinder.entity.cylinder.topRadius._value,x=this.editCylinder.entity.cylinder.bottomRadius._value,y=new Z,v=new Z,w=new Z;this.getNorthPointByDistance(y,v,w),I>0&&(this.topRadiusPoint.position=y),x>0&&(this.bottomRadiusPoint.position=v),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(k(A)&&k(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:k(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},stt=W1e;var q1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,k(this.editEllipse)&&k(this.editEllipse.entity.ellipse)){let E=De.PI_OVER_TWO,I=this.updatePoint(E);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:I,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new Z,m=new Z,C=new Z,E=this.editEllipse.entity.ellipse;this.semiMinorAxis=E.semiMinorAxis._value,this.semiMajorAxis=E.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let I=ae(E.rotation,0);this.center=this.editEllipse.entity.position._value;let x=this.semiMinorAxis*this.semiMinorAxis,y=this.semiMajorAxis*this.semiMajorAxis,v=this.semiMajorAxis*this.semiMinorAxis,w=Z.magnitude(this.center),Q=Z.normalize(this.center,f),M=Z.cross(Z.UNIT_Z,this.center,m);M=Z.normalize(M,M);let B=Z.cross(Q,M,C),D=new Z;return Rx.pointOnEllipsoid(A,I,B,M,x,v,y,w,Q,D)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickSemiMajorAxisPoint)||k(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(k(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(k(this.pickSemiMajorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let E=C*this.semiMinorAxis/this.semiMajorAxis;E>C&&(E=C),this.editEllipse.entity.ellipse.semiMinorAxis=E}else if(k(this.pickSemiMinorAxisPoint)){let C=Z.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(De.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(k(A)&&k(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:k(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ltt=q1e;var j1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,k(this.editEllipsoid)&&k(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let E=this.editEllipsoid.entity.position._value,I=Lt.fromCartesian(E);this.height=I.height;let x=new Z,y=new Z,v=new Z;this.getNorthPointByDistance(x,y,v),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:x,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:y,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=Lt.fromCartesian(f);return this.height=m.height+A,Z.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,E=Vr.eastNorthUpToFixedFrame(C),I=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=I.x,Re.multiplyByPoint(E,A,A),f.y=-I.y,Re.multiplyByPoint(E,f,f),m.z=I.z,Re.multiplyByPoint(E,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)||k(this.pickRadiiXPoint)||k(this.pickRadiiYPoint)||k(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Z.fromRadians(C.longitude,C.latitude,C.height+this.height);if(k(this.currentPoint))this.currentPoint.position=E,this.editEllipsoid.entity.position=E;else{if(k(this.dragPosition)){let v=Z.subtract(m,this.dragPosition,new Z),w=Z.normalize(v,new Z);Z.dot(v,w,v);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=Z.clone(Q);k(this.pickRadiiXPoint)?M.x-=v.x:k(this.pickRadiiYPoint)?M.y+=v.y:k(this.pickRadiiZPoint)&&(M.z+=v.z,this.editEllipsoid.entity.position=this.addHeight(v.z)),Z.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let I=new Z,x=new Z,y=new Z;this.getNorthPointByDistance(I,x,y),this.radiiXPoint.position=I,this.radiiYPoint.position=x,this.radiiZPoint.position=y}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(k(A)&&k(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:k(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Att=j1e;var X1e=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,k(this.editPolygon)&&k(this.editPolygon.entity.polygon))for(let E=0;E<this.editPolygon.entity.polygon.hierarchy._value.positions.length;E++){let I=this.editPolygon.entity.polygon.hierarchy._value.positions[E],x=this.mEarthCtrl.entities.add({name:"polygon_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(k(A)&&k(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},utt=X1e;var Z1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=qe.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,k(this.editModel)&&k(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=Lt.clone(C);E.longitude=De.toDegrees(E.longitude),E.latitude=De.toDegrees(E.latitude),this.editModel.lon=E.longitude,this.editModel.lat=E.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(k(A)&&k(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(k(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},ctt=Z1e;var $1e=class extends Qa{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,k(this.editLabel)&&k(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(k(A)&&k(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:k(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},htt=$1e;var ebe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,k(this.editPolyline)&&k(this.editPolyline.polyline))for(let E=0;E<this.editPolyline.polyline.positions._value.length;E++){let I=this.editPolyline.polyline.positions._value[E],x=this.mEarthCtrl.entities.add({name:"polyline_point",position:I,point:{color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(k(A)&&k(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];k(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},dtt=ebe;var tbe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,k(this.editPolylineVolume)&&k(this.editPolylineVolume.entity.polylineVolume))for(let E=0;E<this.editPolylineVolume.entity.polylineVolume.positions._value.length;E++){let I=this.editPolylineVolume.entity.polylineVolume.positions._value[E],x=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:I,point:{color:qe.WHITE,pixelSize:12,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(x.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let E=0;E<this.pointsId.length;E++){let I=this.pointsId[E];C.push(this.mEarthCtrl.entities.getById(I).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(k(A)&&k(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:k(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},gtt=tbe;var ibe=class extends Qa{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,k(this.editRectangle)&&k(this.editRectangle.entity.rectangle)){let E=this.editRectangle.entity.rectangle.coordinates._value,I=this.editRectangle.entity.rectangle.height._value,x=hi.northwest(E),y=Z.fromRadians(x.longitude,x.latitude,I),v=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:y,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(v.id),x=hi.southeast(E);let w=Z.fromRadians(x.longitude,x.latitude,I),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:qe.WHITE,pixelSize:8,outlineColor:qe.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((k(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(k(this.leftTopPoint)||k(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=Lt.fromCartesian(m),E=this.editRectangle.entity.rectangle.coordinates._value;k(this.leftTopPoint)?(this.leftTopPoint.position=m,E.west=C.longitude,E.north=C.latitude):k(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,E.south=C.latitude,E.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=E}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(k(A)&&k(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:k(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},ftt=ibe;function pp(o,A={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}pp.prototype.start=function(o,A={}){if(this.end(),!!o){if(console.log(o),this.model=o,o._parameter)o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles"?(this.modeltype="b3dm",this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0}):o._parameter.sourceType&&o._parameter.sourceType==="I3S"?(this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)):o._parameter.sourceType&&o._parameter.sourceType==="s3m"?(this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)):(this.modeltype="GLTF",this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0});else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let f=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"I3S"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let f=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,sourceType:"s3m"},this.hpRoll={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0,select:"",angle:0},this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z)}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(A),this}};pp.prototype.initEvent=function(o){this.editHandler=new pr(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.radius=this.model._primitive._boundingSphere.radius;let A,f;this.createAxios(o.select),this.editHandler.setInputAction(m=>{A?(f=m.position,this.modeltype==="b3dm"?this.originPosition=Re.getTranslation(this.model._primitive._root.transform,new Z):this.modeltype==="I3S"?this.originPosition=Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z):this.modeltype==="s3m"?this.originPosition=Re.getTranslation(this.model.modelMatrix,new Z):this.originPosition=Re.getTranslation(this.model._primitive.modelMatrix,new Z),this.startPosition=this._scene.pickPosition(f)):f=void 0},_i.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(m=>{if(f){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(A,f,m),o.callback&&o.callback(A);return}let C=this._scene.pick(m.endPosition);if(C&&C.id)if(C.id._name&&C.id._name==="modeEditAxis"){let E=C.id._id;E==="entityPolylineY"?(A="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):E==="entityPolylineX"?(A="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):E==="entityPolylineZ"&&(A="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else C.id==="axisSphereX"?A="pitch":C.id==="axisSphereY"?A="roll":C.id==="axisSphereZ"?A="heading":(A=void 0,this.setAxisStyle(!1));else A=void 0,this.setAxisStyle(!1)},_i.MOUSE_MOVE),this.editHandler.setInputAction(m=>{this.upDateHpRoll(),f=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},_i.LEFT_UP)};pp.prototype.createAxios=function(o){let A=this.centerPoint,f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius);if((o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon+f,A.lat,A.hei]),material:new R2(qe.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat+m,A.hei]),material:new R2(qe.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new Z.fromDegreesArrayHeights([A.lon,A.lat,A.hei,A.lon,A.lat,A.hei+C]),material:new R2(qe.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,qe.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,qe.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,qe.BLUE);let E=Nt.fromRotationY(De.toRadians(90)),I=Re.fromRotationTranslation(E);Re.multiply(this.AxisX.modelMatrix,I,this.AxisX.modelMatrix);let x=Nt.fromRotationX(De.toRadians(90)),y=Re.fromRotationTranslation(x);Re.multiply(this.AxisY.modelMatrix,y,this.AxisY.modelMatrix)}};pp.prototype.createAxisSphere=function(o,A,f,m){let C={position:[],radius:A};for(let v=0;v<=360;v+=2){let w=Math.sin(De.toRadians(v)),Q=Math.cos(De.toRadians(v)),M=C.radius*Q,B=C.radius*w;C.position.push(new Z(M,B,0))}let E=Vr.eastNorthUpToFixedFrame(f),I=new AS({positions:C.position,width:8}),x=new Un({geometry:I,id:o}),y=new pa({geometryInstances:x,appearance:new vC({material:fa.fromType("Color")}),modelMatrix:E});return y.appearance.material.uniforms.color=m,this._scene.primitives.add(y)};pp.prototype.edit=function(o,A,f){if(o){let m=this.originPosition,C=this.startPosition,E=this._scene.pickPosition(f.endPosition),I=this.toDegrees(m),x=this.toDegrees(C),y=this.toDegrees(E),v=this._scene.cartesianToCanvasCoordinates(m),w=f.endPosition.y-A.y;if(o==="x"){let Q=x.lon-y.lon;I.lon-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="y"){let Q=x.lat-y.lat;I.lat-=Q*.7,this.setAxisPosition(I),this.setPosition(I)}else if(o==="z"){let Q=x.hei-I.hei,M=w*Math.abs(Q/(A.y-v.y));I.hei-=M*.4,this.setAxisPosition(I),this.setPosition(I)}else if(o==="heading"){let Q=this.arge(v,A,f.endPosition,"+-",!0),M=this.hpRoll.heading-Q;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let B=this.arge({x:I.lon,y:I.lat},{x:I.lon+this.radius,y:I.lat},{x:x.lon,y:x.lat},"360");this.setRotateLine("z",m,B,Q)}else if(o==="pitch"){let Q=this.hpRoll.pitch,M=this.arge(v,A,f.endPosition,"+-",!0),D=this.toDegrees(this._scene.camera.position).lon-I.lon,S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;D>0?(Q+=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,-M):this.setRotateLine("x",m,-T,-M)):(Q-=M,x.lat-I.lat>0?this.setRotateLine("x",m,T,M):this.setRotateLine("x",m,-T,M)),this.hpRoll.select="pitch",this.hpRoll.angle=Q,this.setRotate("pitch",Q)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-I.lat,B=this.hpRoll.roll,D=this.arge(v,A,f.endPosition,"+-",!0),S=Z.subtract(C,m,new Z),P=Z.normalize(m,new Z),T=Z.angleBetween(S,P)*180/Math.PI;M>0?(B+=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,D):this.setRotateLine("y",m,-T,D)):(B-=D,x.lon-I.lon>0?this.setRotateLine("y",m,T,-D):this.setRotateLine("y",m,-T,-D)),this.hpRoll.select="roll",this.hpRoll.angle=B,this.setRotate("roll",B)}}};pp.prototype.setPosition=function(o,A){let f=Z.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(-this.hpRoll.roll),De.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="I3S"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(f,m)}else if(this.modeltype==="s3m"){let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll));this.model.modelMatrix=new Vr.headingPitchRollToFixedFrame(f,m)}else{let m=new Wl(De.toRadians(this.hpRoll.heading),De.toRadians(this.hpRoll.pitch),De.toRadians(this.hpRoll.roll)),C=Vr.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(f,m,gi.WGS84,C)}};pp.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};pp.prototype.setAxisPosition=function(o){let A=Z.fromDegrees(o.lon,o.lat,o.hei),f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),C=1.7*Number(this.radius),E=Z.fromDegrees(o.lon+f,o.lat,o.hei),I=Z.fromDegrees(o.lon,o.lat+m,o.hei),x=Z.fromDegrees(o.lon,o.lat,o.hei+C);this._earthCtrl.entities.values[0]._polyline.positions=new Kr(function(){return[A,E]},!1),this._earthCtrl.entities.values[1]._polyline.positions=new Kr(function(){return[A,I]},!1),this._earthCtrl.entities.values[2]._polyline.positions=new Kr(function(){return[A,x]},!1)};pp.prototype.setAxisStyle=function(o,A){if(o){if(A==="x"){let f=this._earthCtrl.entities.getById("entityPolylineX");f._polyline._material._color._value=qe.YELLOW}else if(A==="y"){let f=this._earthCtrl.entities.getById("entityPolylineY");f._polyline._material._color._value=qe.YELLOW}else if(A==="z"){let f=this._earthCtrl.entities.getById("entityPolylineZ");f._polyline._material._color._value=qe.YELLOW}}else o||(this.selectAxis==="x"?(this.selectAxis=void 0,this._earthCtrl.entities.values[0]._polyline._material._color._value=qe.RED):this.selectAxis==="y"?(this.selectAxis=void 0,this._earthCtrl.entities.values[1]._polyline._material._color._value=qe.GREEN):this.selectAxis==="z"&&(this.selectAxis=void 0,this._earthCtrl.entities.values[2]._polyline._material._color._value=qe.BLUE))};pp.prototype.setRotate=function(o,A){let f=this.hpRoll.heading,m=this.hpRoll.pitch,C=this.hpRoll.roll;if(o==="heading"?f=A:o==="pitch"?m=A:o==="roll"&&(C=A),this.modeltype==="b3dm"){let E=new Wl(De.toRadians(f),De.toRadians(-C),De.toRadians(m));this.model._primitive._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive._root.transform,new Z),E)}else if(this.modeltype==="I3S"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._layers[0]._tileset._root.transform=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._layers[0]._tileset._root.transform,new Z),E)}else if(this.modeltype==="s3m"){let E=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model.modelMatrix,new Z),E)}else{let E=Vr.localFrameToFixedFrameGenerator("north","west"),I=new Wl(De.toRadians(f),De.toRadians(m),De.toRadians(C));this.model._primitive.modelMatrix=Vr.headingPitchRollToFixedFrame(Re.getTranslation(this.model._primitive.modelMatrix,new Z),I,gi.WGS84,E)}};pp.prototype.setRotateLine=function(o,A,f,m){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new Kr(function(){return De.toRadians(m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(De.toRadians(360-f),0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(0),maximumClock:De.toRadians(0),minimumCone:De.toRadians(90),maximumCone:De.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(90.1),maximumClock:De.toRadians(90),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),material:qe.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new Kr(function(){return De.toRadians(m+f)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:A,orientation:Vr.headingPitchRollQuaternion(A,new Wl(0,0,0)),ellipsoid:{radii:new Z(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new Z(.1,.1,.1),minimumClock:De.toRadians(.1),maximumClock:De.toRadians(0),minimumCone:De.toRadians(f),maximumCone:De.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:qe.YELLOW}}))};pp.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};pp.prototype.toDegrees=function(o){let A=Lt.fromCartesian(o);return{lon:De.toDegrees(A.longitude),lat:De.toDegrees(A.latitude),hei:A.height}};pp.prototype.arge=function(o,A,f,m="180",C=!1){let E=Math.sqrt(Math.pow(o.x-A.x,2)+Math.pow(o.y-A.y,2)),I=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),x=Math.sqrt(Math.pow(A.x-f.x,2)+Math.pow(A.y-f.y,2)),y=(Math.pow(E,2)+Math.pow(I,2)-Math.pow(x,2))/(2*E*I),v=Math.acos(y)*180/Math.PI;if(m==="360"||m==="+-"){let w=C?-1:1;this.isClockwise([[A.x,w*A.y],[o.x,w*o.y],[f.x,w*f.y],[A.x,w*A.y]])||(m==="+-"?v=-v:v=360-v)}return Number(v.toFixed(2))};pp.prototype.isClockwise=function(o){let A=ws.lineString(o);return ws.booleanClockwise(A)};pp.prototype.matrixGetRotation=function(o){let A=Vr.eastNorthUpToFixedFrame(Re.getTranslation(o,new Z),gi.WGS84,new Re),f=Re.multiply(Re.inverse(A,new Re),o,new Re),m=Re.getRotation(f,new Nt),C=yr.fromRotationMatrix(m),E=Wl.fromQuaternion(C),I=De.toDegrees(E.heading),x=De.toDegrees(E.pitch),y=De.toDegrees(E.roll);return{heading:I,pitch:x,roll:y}};var ptt=pp;function Mc(o){this._earthCtrl=o,this._coreMap=o.coreMap}Mc.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new ott(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};Mc.prototype.updatePoint=function(o,A){o.updatePoint(A)};Mc.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new dtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};Mc.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};Mc.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new utt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};Mc.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};Mc.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new att(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};Mc.prototype.updateBox=function(o,A){o.updateBox(A)};Mc.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new Att(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};Mc.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};Mc.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new stt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};Mc.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};Mc.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new ctt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};Mc.prototype.updateModel=function(o,A){o.updateModel(A)};Mc.prototype.createTransformEdit=function(o){return new ptt(this._earthCtrl,{model:o})};Mc.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new ntt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};Mc.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};Mc.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new htt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};Mc.prototype.updateLabel=function(o,A){o.updateLabel(A)};Mc.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new ftt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};Mc.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};Mc.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new ltt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};Mc.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};Mc.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new gtt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};Mc.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};Mc.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var rbe=Mc;function mp(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}mp.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],E="",I=[],x,y=this.scene.globe.ellipsoid,v={spot:[],distance:[],label:[],polyline:[]},w={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(w.point=A.point),k(A.polyline)&&(w.polyline=A.polyline));let Q=new nI;this.scene.primitives.add(Q);let M=new Pu,B=new pr(f.scene.canvas),D=document.createElement("div");ru(".map-widget",D),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let P=document.getElementById("toolTip");P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R;m=!0;let T=function(U){let N=0,H=`${0}\u7C73`,J,K,X,j,ee,ie;for(let z=0;z<U.length-1;z+=1)J=y.cartesianToCartographic(U[z]),K=M.project(J),X=K.x,j=K.y,J=y.cartesianToCartographic(U[z+1]),K=M.project(J),ee=K.x,ie=K.y,N=N+Math.sqrt((X-ee)*(X-ee)+(j-ie)*(j-ie));return N>0&&(H=`${N.toFixed(2)}\u7C73`),N/1e3>=1&&(H=`${(N/1e3).toFixed(2)}\u5343\u7C73`),H},L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<2)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let H=fa.fromType(fa.ColorType);H.uniforms.color=new qe(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polyline.positions=new Kr(H,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,v.polyline.push(this.lineEntity)},U}();B.setInputAction(function(U){let N,H;P.style.left=`${U.endPosition.x+10}px`,P.style.top=`${U.endPosition.y+20}px`,P.style.display="block",P.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let J=!1,K=f.camera.getPickRay(U.endPosition);K&&(N=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition);if(X){console.log("feature",X);let j=f.scene.pickPosition(U.endPosition);j&&(N=j),J=!0}if(!!N&&(H=gi.WGS84.cartesianToCartographic(N),H)){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){if(C.length<1)return;k(x)?(x.path.pop(),x.path.push(ee)):(C.push(ee),x=new L(C));let ie=T(x.path);f.entities.remove(R),R=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:x.path[x.path.length-1],label:{text:`\u603B\u957F\uFF1A${ie}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},_i.MOUSE_MOVE);let F=function(U){I.push(U);let N=[];if(I.length>1){let H=I[I.length-2],J=I[I.length-1],K=Math.abs(H.longitude-J.longitude)*1e7,X=Math.abs(H.latitude-J.latitude)*1e7;K>X&&(X=K);let j=parseInt(X/10);j>1e3&&(j=1e3),j<2&&(j=2);for(let ee=0;ee<j;++ee)N.push(new Lt(De.lerp(H.longitude,J.longitude,ee/(j-1)),De.lerp(H.latitude,J.latitude,ee/(j-1))));N.push(J.clone())}else N=I;if(N.length>0)for(let H=0;H<N.length;H++){U=N[H];let J=f.scene.globe.getHeight(U),K=Z.fromDegrees(U.longitude/Math.PI*180,U.latitude/Math.PI*180,J);C.push(K)}};return B.setInputAction(function(U){let N,H,J=!1,K=f.camera.getPickRay(U.position);if(K&&(N=f.scene.globe.pick(K,f.scene)),f.scene.pick(U.position)){let j=f.scene.pickPosition(U.position);j&&(N=j),J=!0}if(N&&(H=gi.WGS84.cartesianToCartographic(N)),H){let j;J?j=f.scene.sampleHeight(H):j=f.scene.globe.getHeight(H);let ee=Z.fromDegrees(H.longitude/Math.PI*180,H.latitude/Math.PI*180,j);if(m){x&&x.path.pop(),F(H);let ie="0\u7C73";x&&(ie=T(x.path)),E=ie,v.spot.push(ee),v.distance.push(ie);let z=f.entities.add({position:ee,point:{pixelSize:5,color:w.point,outlineColor:qe.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ie,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v.label.push(z),f._points.push(z)}}},_i.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(R),f._points[f._points.length-1].label.text=E,B.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(v),P.style.display="none"},_i.RIGHT_CLICK),this};mp.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new pr(f.scene.canvas),C=[],E=null,I="0\u7C73",x=null,y,v="",w,Q=document.createElement("div");ru(".map-widget",Q),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let D={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:qe.RED,polyline:qe.fromRgba(4286644096)};k(A)&&(k(A.point)&&(S.point=A.point),k(A.polyline)&&(S.polyline=A.polyline));let P=function(){function R(T){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!1}},this.positions=T,this._init()}return R.prototype._init=function(){let T=this,L=function(){return T.positions};this.options.polyline.positions=new Kr(L,!1);let F=f.entities.add(this.options);f.item=F,D.ployline.push(F);let U=f.getuid();D.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${U}`},R}();return m.setInputAction(function(R){if(f.scene.bim){let T=f.scene.bim.PickWorldPositionSync(R.endPosition.x,R.endPosition.y);T[0]===0?x=f.scene.pickPosition(R.endPosition):x=new Z(T[0],T[1],T[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.endPosition);!x||(B.style.left=`${R.endPosition.x+10}px`,B.style.top=`${R.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(k(E)?(C.pop(),C.push(x)):E=new P(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',I=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${I}`,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},_i.MOUSE_MOVE),m.setInputAction(function(R){if(f.scene.bim){let L=f.scene.bim.PickWorldPositionSync(R.position.x,R.position.y);L[0]===0?x=f.scene.pickPosition(R.position):x=new Z(L[0],L[1],L[2]),console.log("????????",x)}else x=f.scene.pickPosition(R.position);if(!x)return;C.length===0&&C.push(x.clone()),C.push(x);let T=I;v=`\u603B\u957F\uFF1A${I}`,y=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:S.point,outlineColor:qe.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:T,show:!0,font:"26px \u6977\u4F53",fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-20),heightReference:tn.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(y),D.spot.push(x),D.distance.push(I),D.label.push(y)},_i.LEFT_CLICK),m.setInputAction(function(R){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=v),m.destroy(),C.pop(),k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=Lt.fromCartesian(o[m]),E=Lt.fromCartesian(o[m+1]),I=new Ig;I.setEndPoints(C,E);let x=I.surfaceDistance;x=Math.sqrt(Math.pow(x,2)+Math.pow(E.height-C.height,2)),A=A+x}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};mp.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new pr(f.scene._imageryLayerCollection),E=document.getElementById("toolTip");E||(ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),E=document.getElementById("toolTip")),E.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let I=[],x={},y=[],v=[],w=null,Q=null,M,B={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(B.point=A.point),k(A.polyline)&&(B.polyline=A.polyline),k(A.polygon)&&(B.polygon=A.polygon));let D={mj:0,label:[],polygon:[]};E.style.display="block";let S=function(){function P(R){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=R,this._init()}return P.prototype._init=function(){let R=this,T=function(){return R.hierarchy};this.options.polygon.hierarchy=new Kr(T,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,D.polygon=this.polygon},P}();return C.setInputAction(function(P){if(E.style.left=`${P.endPosition.x+10}px`,E.style.top=`${P.endPosition.y+20}px`,f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.endPosition.x,P.endPosition.y);U[0]===0?Q=f.scene.pickPosition(P.endPosition):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.endPosition);if(!Q)return;let R=Lt.fromCartesian(Q),T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;if(I.length>=2){k(w)?(I.pop(),I.push(Q),x=new In(I),v.pop(),v.push({lon:T,lat:L,hei:F})):(x=new In(I),w=new S(x));let U=f.getArea(v,I);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.label=M}},_i.MOUSE_MOVE),C.setInputAction(function(P){if(f.scene.bim){let U=f.scene.bim.PickWorldPositionSync(P.position.x,P.position.y);U[0]===0?Q=f.scene.pickPosition(P.position):Q=new Z(U[0],U[1],U[2])}else Q=f.scene.pickPosition(P.position);if(!Q)return;let R=Lt.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",R);let T=De.toDegrees(R.longitude),L=De.toDegrees(R.latitude),F=R.height;I.length===0&&(I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F}),I.push(Q.clone()),x=new In(I),v.push({lon:T,lat:L,hei:F})),I.push(Q),x=new In(I),y.push({lon:T,lat:L,hei:F}),v.push({lon:T,lat:L,hei:F})},_i.LEFT_CLICK),C.setInputAction(function(P){E.style.display="none",f.entities.remove(M),C.destroy();let R=f.getArea(v,I);m=R;let T=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:I[I.length-1],label:{text:R,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(T),f._lable=T,D.mj=m,D.label=T,k(o)&&typeof o=="function"&&o(D)},_i.RIGHT_CLICK),this};mp.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,E=[],I={},x,y=f.scene,v=y.globe.ellipsoid,w=new nI;y.primitives.add(w);let Q,M,B=0,D={point:qe.RED,polyline:qe.fromRgba(4286644096),polygon:qe.fromRgba(4286644096).withAlpha(.5)};k(A)&&(k(A.point)&&(D.point=A.point),k(A.polyline)&&(D.polyline=A.polyline),k(A.polygon)&&(D.polygon=A.polygon));let S=document.createElement("div");ru(".map-widget",S),ru(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let R=document.getElementById("toolTip");R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T=new pr(y.canvas),L=function(){function U(N){if(!k(N))throw new ni("positions is required!");if(N.length<3)throw new ni("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:D.polygon,clampToGround:!1}},this.path=N,this._init()}return U.prototype._init=function(){let N=this,H=function(){return N.path};this.options.polygon.hierarchy=new Kr(H,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},U}();T.setInputAction(function(U){let N=0;f.entities.remove(M);let H,J,K=f.scene.camera.getPickRay(U.endPosition);K&&(H=f.scene.globe.pick(K,f.scene));let X=f.scene.pick(U.endPosition),j=!1;if(X){let ie=f.scene.pickPosition(U.endPosition);ie&&(H=ie),j=!0}if(!H)return;let ee=function(ie){let z=new Array(ie.length),oe=function(he){return he.longitude=he.longitude/Math.PI*180,he.latitude=he.latitude/Math.PI*180,he},le=function(he){let ge=0;for(let de=0;de<he.length;de++){let fe=he[de],G;de<he.length-1?G=he[de+1]:G=he[0],ge+=fe.x*G.y-G.x*fe.y}return ge/2};for(let he=0;he<ie.length;he++)z[he]=oe(v.cartesianToCartographic(ie[he]));let Ae=0;for(let he=0;he<z.length;he++)Ae+=z[he].longitude;Ae=Ae/z.length;for(let he=0;he<z.length;he++)z[he]=f.Gauss_to_XY(z[he].longitude,z[he].latitude,Ae);return Math.abs(le(z))};if(J=gi.WGS84.cartesianToCartographic(H),J&&C){if(R.style.left=`${U.endPosition.x+10}px`,R.style.top=`${U.endPosition.y+20}px`,R.style.display="block",E.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:`${N}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(k(x)?(x.path.positions.pop(),x.path.positions.push(H)):(E.push(H),I=new In(E),x=new L(I)),E.length>=2){R.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=String(ee(x.path.positions));ie=ie.substr(0,ie.indexOf(".",0)),ie.length<6?N=`${ie}\u5E73\u65B9\u7C73`:(ie=String(ie/1e6),ie=ie.substr(0,ie.indexOf(".",0)+3),N=`${ie}\u5E73\u65B9\u5343\u7C73`),m.mj=N,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:H,label:{text:N,font:"26px \u6977\u4F53",show:!0,fillColor:qe.WHITE,style:fu.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:on.BOTTOM,pixelOffset:new tt(20,-40),heightReference:tn.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},_i.MOUSE_MOVE),T.setInputAction(function(U){let N;B=1;let H=f.scene.camera.getPickRay(U.position);H&&(N=f.scene.globe.pick(H,f.scene));let J=f.scene.pick(U.position),K=!1;if(J){let X=f.scene.pickPosition(U.position);X&&(N=X),K=!0}N&&C&&(E.push(N),I=new In(E))},_i.LEFT_CLICK),T.setInputAction(function(){T.removeInputAction(_i.LEFT_CLICK),T.removeInputAction(_i.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:E[E.length-1],pixelOffset:new tt(0,20),eyeOffset:new Z(0,0,0),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:1,color:new qe(1,1,1,1)}),R.style.display="none",T.destroy(),k(o)&&typeof o=="function"&&o(m)},_i.RIGHT_CLICK);let F=function(U){let N=0,H=0,J=0;for(let X=0;X<U.length;X++)N+=U[X].x,H+=U[X].y,J+=U[X].z;return new Z(N/U.length,H/U.length,J/U.length)};return this};mp.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};mp.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,E,I,x,y;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,E=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,I=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,x=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,y=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-E/2*Math.sin(2*o)+I/4*Math.sin(4*o)-x/6*Math.sin(6*o)+y/8*Math.sin(8*o))};mp.prototype.to_Radian=function(o){return o*Math.PI/180};mp.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,E=Math.sqrt(6378137*6378137-C*C)/C,I=0,x=0,y=0,v=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);v=this.to_N(A),y=v*Math.cos(A),I=Math.tan(A),x=E*M;let B=Math.pow(I,2),D=Math.pow(I,4),S=Math.pow(x,2),P=Math.pow(x,4),R=Math.pow(M,3),T=Math.pow(M,5),L=this.to_Sm(A)+Math.pow(Q,2)/2*y*M*I+Math.pow(Q,4)/24*I*y*R*(5-B+9*S+4*P)+Math.pow(Q,6)/720*I*y*T*(61-58*I*I+D+270*S-330*I*I*S),F=Q*v*M+Math.pow(Q,3)/6*v*R*(1-I*I+x*x)+Math.pow(Q,5)/120*v*T*(5-18*I*I+D+14*S-58*S*B);return new tt(F,L)};mp.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,E=(m+2)%o.length,I=this.Angle(o[m],o[C],o[E]),x=this.getdistance(A[m],A[C]),y=this.getdistance(A[C],A[E]);f+=x*y*Math.abs(Math.sin(I))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};mp.prototype.getdistance=function(o,A){let f=Lt.fromCartesian(o),m=Lt.fromCartesian(A),C=new Ig;C.setEndPoints(f,m);let E=C.surfaceDistance;return E=Math.sqrt(Math.pow(E,2)+Math.pow(m.height-f.height,2)),E};mp.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,E=o.lon*f,I=A.lat*f,x=A.lon*f,y=-Math.atan2(Math.sin(E-x)*Math.cos(I),Math.cos(C)*Math.sin(I)-Math.sin(C)*Math.cos(I)*Math.cos(E-x));return y<0&&(y+=Math.PI*2),y=y*m,y};mp.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),E=m-C;return E<0&&(E+=360),E};mp.prototype.getuid=function(){return this.uuid(8,16)};mp.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|De.nextRandomNumber()*A];else{let E;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(E=0|De.nextRandomNumber()*16,m[C]=f[C===19?E&3|8:E])}return m.join("")};mp.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var IJ=mp;function Tv(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=ae(A.show,!0),this._lon=ae(A.lon,121),this._lat=ae(A.lat,31),this._height=ae(A.height,10),this._heading=ae(A.heading,0),this._pitch=ae(A.pitch,0),this._distance=ae(A.distance,300),this._position=Z.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=ae(A.horizontalViewAngle,90),this._verticalViewAngle=ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=ae(A.visibleAreaColor,qe.GREEN.withAlpha(.4)),this._invisibleAreaColor=ae(A.invisibleAreaColor,qe.RED.withAlpha(.4)),this._size=ae(A.size,10240),this._softShadows=ae(A.softShadows,!0),this._colorStyle=ae(A.colorStyle,qe.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(Tv.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});Tv.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};Tv.prototype.removeFromMap=function(){let o=this;k(o.viewShedMap)&&(o.viewShedMap.enabled=!1),k(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};Tv.prototype.visualConeShow=function(o){let A=this;k(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};Tv.prototype.addVisualPyramid=function(){let o=this,A=new zO({radii:new Kr(function(){return new Z(o._distance,o._distance,o._distance)},!1),minimumClock:new Kr(function(){return De.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Kr(function(){return De.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Kr(function(){return De.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Kr(function(){return De.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Kr(function(){return o._colorStyle},!1)}),f=new Fu({position:new Kr(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};Tv.prototype.createLightCamera=function(){k(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ms(this._coreMap.scene),this._lightCamera.position=this._position};Tv.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!k(o)&&(k(o.lon)||k(o.lat)||k(o.height)||k(o.heading)||k(o.pitch)||k(o.roll)||k(o.far)||k(o.distance)||k(o.verticalViewAngle)||k(o.horizontalViewAngle))){let m=this._parameter;for(let x in o)o.hasOwnProperty(x)&&k(m[x])&&(m[x]=o[x]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=Z.fromDegrees(m.lon,m.lat,m.height);let C=De.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let E=De.toRadians(A._horizontalViewAngle),I=De.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(E/2)/Math.tan(I/2),E>I?f.frustum.fov=E:f.frustum.fov=I}};Tv.prototype.createShadowMap=function(){if(k(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new _4({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Gm=new Z;Tv.prototype.drawViewCentrum=function(){let o=this;function A(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let f=this._earthCtrl.entities.add({polyline:{positions:new Kr(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let C=this._earthCtrl.entities.add({polyline:{positions:new Kr(m,!1),material:this._colorStyle}});this._lineArray.push(C);function E(){let v=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=new EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let I=this._earthCtrl.entities.add({polyline:{positions:new Kr(E,!1),material:this._colorStyle}});this._lineArray.push(I);function x(){let v=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,D=M(w),S=B(w),P=M(v),R=B(v);Gm.x=Q.x*D*R,Gm.y=Q.y*D*P,Gm.z=Q.z*S;let T=EB.changeCartesian3ByScalar(o._position,Gm);return[o._position,T]}let y=this._earthCtrl.entities.add({polyline:{positions:new Kr(x,!1),material:this._colorStyle}});this._lineArray.push(y)};Tv.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};Tv.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=De.toRadians(this._horizontalViewAngle),A=De.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:De.toRadians(this._heading),pitch:De.toRadians(this._pitch),roll:0}})};var nbe=Tv;var obe=gi.WGS84;function Kh(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=TBi(this.coreMap.container)}function abe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?abe(o[f],null):A[f];return A}function mtt(o,A){let f=abe(o),m;for(m in A)f[m]===void 0&&(f[m]=abe(A[m]));return f}function TBi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let E=document.createElement("DIV");E.className="twipsy-inner",m.appendChild(E),this._div=m,this._title=E,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Kh.prototype.addToolbar=function(o,A){return A=mtt(A,{container:o}),new Kh.Toolbar(this,A)};var Ctt={shiftX:0,shiftY:0};Kh.prototype.createBillboardGroup=function(o,A,f){let m=new Kh.BillboardGroup(this,A);return m.addBillboards(o,f),m};Kh.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=mtt(A,Ctt);let f=new nI;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Kh.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new tt(this._options.shiftX,this._options.shiftY),eyeOffset:new Z(0,0,-1e3),horizontalOrigin:iu.CENTER,verticalOrigin:on.CENTER,scale:.3,image:ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new qe(1,1,1,1)});if(A){let E=function(x){C.enableRotate=x},I=function(){let x=0;for(let y=m._orderedBillboards.length;x<y&&m._orderedBillboards[x]!==f;++x);return x},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let x=this,y=new pr(x._scene.canvas);setListener(f,"leftDown",function(v){function w(M){f.position=M;for(let B=0,D=x._orderedBillboards.length;B<D&&x._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(I(),M)}function Q(M){y.destroy(),E(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(I(),M)}y.setInputAction(function(M){let B=x._scene.camera.pickEllipsoid(M.endPosition,obe);B?w(B):Q(B)},_i.MOUSE_MOVE),y.setInputAction(function(M){Q(x._scene.camera.pickEllipsoid(M.position,obe))},_i.LEFT_UP),E(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(I(),x._scene.camera.pickEllipsoid(v,obe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(x){A.onDoubleClick(I())}),A.onClick&&setListener(f,"leftClick",function(x){A.onClick(I())}),A.tooltip&&(setListener(f,"mouseMove",function(x){m._drawHelper._tooltip.showAt(x,A.tooltip())}),setListener(f,"mouseOut",function(x){m._drawHelper._tooltip.setVisible(!1)}))}return f};Kh.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Kh.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Kh.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Kh.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Kh.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Kh.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Kh.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Kh.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Kh.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Kh.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Kh.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,E=[],I=[],x;this._positions=I;let y=new pr(f.canvas);this._mouseHandler=y;let v=new Kh.BillboardGroup(this,Ctt);this._markers=v,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),y.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),D=Lt.fromCartesian(B),S=De.toDegrees(D.longitude),P=De.toDegrees(D.latitude);if(B){if(E.length===0&&(E.push(S,P),I.push(B),x=B,v.addBillboard(x)),I.length>=4){let R=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(R!==void 0){let T=R.x-Q.position.x,L=R.y-Q.position.y;if(T*T+L*L<16){E.splice(E.length-2,2),I.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}E.push(S,P),I.push(B),v.addBillboard(B),I.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:Z.fromDegreesArray(E),material:qe.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),_i.LEFT_CLICK),y.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(I.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),D=f.globe.pick(B,f),S=Lt.fromCartesian(D),P=De.toDegrees(S.longitude),R=De.toDegrees(S.latitude);if(D&&(E.splice(E.length-2,2),I.pop(),E.push(P,R),I.push(D),v.getBillboard(I.length-1).position=D,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),I.length>=3&&I.length>=4)){let T=ms.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,x);if(T!==void 0){let L=T.x-M.x,F=T.y-M.y;L*L+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),_i.MOUSE_MOVE),y.setInputAction(function(Q){I.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),_i.LEFT_DOUBLE_CLICK);function w(){return Z.fromDegreesArray(E)}};Kh.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:qe.RED.withAlpha(.5),outline:!0,outlineColor:qe.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Kh.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Kh.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Kh.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function PBi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=Lt.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,E=0,I=0,x=0,y=0,v=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(E=A[0],I=f[0]):(E=A[Q+1],I=f[Q+1]),y=m*I-E*C,x+=y,v+=(m+E)*y,w+=(C+I)*y;return x*=.5,v/=6*x,w/=6*x,new Lt(v,w)}function RBi(o,A,f){let m=Z.distance(o,A),C=Z.distance(A,f),E=Z.distance(f,o),I=(m+C+E)/2;return Math.sqrt(I*(I-m)*(I-C)*(I-E))}Kh.prototype.computeCutVolume=function(){let o=15e3;for(let L=0;L<this._positions.length;L++){let F=Lt.fromCartesian(this._positions[L]),U=this._scene.globe.getHeight(F);o>U&&(o=U)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new bc.fromPositions({positions:this._positions,vertexFormat:ma.FLAT_VERTEX_FORMAT,granularity:A}),m=new bc.createGeometry(f),C=0,E=0,I,x,y,v,w,Q,M,B,D,S,P,R;for(let L=0;L<m.indices.length;L+=3)I=m.indices[L],x=m.indices[L+1],y=m.indices[L+2],S=new Z(m.attributes.position.values[I*3],m.attributes.position.values[I*3+1],m.attributes.position.values[I*3+2]),P=Lt.fromCartesian(S),v=this._scene.globe.getHeight(P),M=Z.fromRadians(P.longitude,P.latitude,0),E<v&&(E=v),S=new Z(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),P=Lt.fromCartesian(S),w=this._scene.globe.getHeight(P),B=Z.fromRadians(P.longitude,P.latitude,0),E<w&&(E=w),S=new Z(m.attributes.position.values[y*3],m.attributes.position.values[y*3+1],m.attributes.position.values[y*3+2]),P=Lt.fromCartesian(S),Q=this._scene.globe.getHeight(P),D=Z.fromRadians(P.longitude,P.latitude,0),E<Q&&(E=Q),R=RBi(M,B,D),C=C+R*(v-o+w-o+Q-o)/3;let T=PBi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:Z.fromRadians(T.longitude,T.latitude,E+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:E,volume:C}};var sbe=Kh;function Ett(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=ae(A.color,new qe(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new ni("invalid positions length!");this._duration=ae(A.duration,4e3),this._minHeight=ae(A.minHeight,0),this._maxHeight=ae(A.maxHeight,100),this._image=A.image,this._pps=null}function LBi(o,A){let f=Lt.fromCartesian(o[0]),m=f.longitude,C=f.latitude,E=m,I=C,x=A;for(let y=1;y<o.length;y++){let v=Lt.fromCartesian(o[y]);m>v.longitude?m=v.longitude:E<v.longitude&&(E=v.longitude),C>v.latitude?C=v.latitude:I<v.latitude&&(I=v.latitude)}return new Z.fromRadians((m+E)/2,(C+I)/2,x)}function FBi(o){if(k(o._pps))return;let A=LBi(o._positions,o._minHeight),f=Lt.fromCartesian(A),m=new kt(A.x,A.y,A.z,1),C=new Lt(f.longitude,f.latitude,o.maxHeight+100),E=Lt.toCartesian(C),I=new kt(E.x,E.y,E.z,1),x=new kt,y=new kt,v=new Z,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new Jo({fragmentShader:kBi(Q),uniforms:{u_floodCenterEC:function(){return Re.multiplyByVector(w._viewMatrix,m,x)},u_floodPlaneNormalEC:function(){let B=Re.multiplyByVector(w._viewMatrix,m,x),D=Re.multiplyByVector(w._viewMatrix,I,y);return v.x=D.x-B.x,v.y=D.y-B.y,v.z=D.z-B.z,Z.normalize(v,v),v},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function NBi(o){k(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function kBi(o){return`uniform sampler2D colorTexture;
 uniform sampler2D depthTexture;
 in vec2 v_textureCoordinates;
 uniform vec4 u_floodCenterEC;

--
Gitblit v1.9.3