From fe0b336af036e874203a978dd8e6391039ec545a Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期日, 28 四月 2024 16:19:18 +0800
Subject: [PATCH] 代码跟新

---
 src/components/viewer.vue |  192 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 142 insertions(+), 50 deletions(-)

diff --git a/src/components/viewer.vue b/src/components/viewer.vue
index c85fdf2..6b5273a 100644
--- a/src/components/viewer.vue
+++ b/src/components/viewer.vue
@@ -1,5 +1,11 @@
 <template>
   <div>
+    <div class="imgbox"
+         v-if="showFlyimg">
+      <img src="../assets/image/feixingqi.png"
+           alt="" />
+    </div>
+
     <div id="app1"></div>
   </div>
 </template>
@@ -18,21 +24,23 @@
   light,
 } from "@/utils/work";
 import bus from "@/utils/bus";
-import { getVectorList, getRadio } from "@/api/http";
+import { getVectorList,getRadio } from "@/api/http";
 export default {
   name: "App",
-  data() {
-    return {};
+  data () {
+    return {
+      showFlyimg: false,
+    };
   },
   methods: {
-    init() {
-      const that = this;
-      window.currentsubindex = 1;
-      let _core = new SmartEarth.Core();
-      window.tedp = new this.$trame({
+    init () {
+      const that=this;
+      window.currentsubindex=1;
+      let _core=new SmartEarth.Core();
+      window.tedp=new this.$trame({
         elem: "app1",
         width: 4992,
-        prop: [0, 0],
+        prop: [0,0],
         height: 2560,
         navtop: 300,
         gisType: "hf",
@@ -56,13 +64,14 @@
         },
         gisInit: (webgis) => {
           //杩斿洖鍦板浘瀵硅薄
-          window.Sgworld = webgis;
-          window.sgworld = webgis;
-          window.Viewer = webgis.Viewer;
-          window.viewer = webgis.Viewer;
-          window.Cesium = Cesium;
+          window.Sgworld=webgis;
+          window.sgworld=webgis;
+          window.Viewer=webgis.Viewer;
+          window.viewer=webgis.Viewer;
+          window.Cesium=Cesium;
+          let that=this;
 
-          window.layers = window.sgworld.Viewer.scene.imageryLayers;
+          window.layers=window.sgworld.Viewer.scene.imageryLayers;
           // const blackMarble = layers.addImageryProvider(
           //   new Cesium.IonImageryProvider({ assetId: 3812 })
           // );
@@ -70,9 +79,9 @@
           // blackMarble.alpha = 0.0;
           // blackMarble.brightness = 2.0;
           // 鍦扮悆棰滆壊
-          Viewer.scene.globe.baseColor =
+          Viewer.scene.globe.baseColor=
             Cesium.Color.fromCssColorString("#272d39");
-            // //椋炲悜骞垮窞
+          // //椋炲悜骞垮窞
           // window.Viewer.camera.flyTo({
           //   destination: Cesium.Cartesian3.fromDegrees(
           //     113.29503528791071,
@@ -87,54 +96,82 @@
           // });
           window.Viewer.camera.flyTo({
             destination: Cesium.Cartesian3.fromDegrees(
-              120.37492388223879,
-              30.91054534935262,
-              97611.15133443385
+              109.26943037557801,
+              35.94483222064199,
+              7052792.362399457
             ),
             orientation: {
-              heading: 1.249372341578318,
-              pitch: -0.7222154573481174,
+              heading: 6.166296249767834,
+              pitch: -1.564875679684365,
               roll: 0,
             },
+            complete: function callback () {
+              viewer.camera.changed.addEventListener(() => {
+                // 瑙嗛珮 km
+                let alt=(
+                  viewer.camera.positionCartographic.height/1000
+                ).toFixed(2);
+                // 鏂逛綅瑙�
+                let heading=Cesium.Math.toDegrees(
+                  viewer.camera.heading
+                ).toFixed(2);
+                // 淇话瑙�
+                let pitch=Cesium.Math.toDegrees(viewer.camera.pitch).toFixed(
+                  2
+                );
+                // 缈绘粴瑙�
+                let roll=Cesium.Math.toDegrees(viewer.camera.roll).toFixed(2);
+                // 绾у埆
+                let level=0;
+                let tileRender=viewer.scene._globe._surface._tilesToRender;
+                if(tileRender&&tileRender.length>0) {
+                  level=viewer.scene._globe._surface._tilesToRender[0]._level;
+                }
+                // let str = `绾ф暟锛�${level} 瑙嗛珮锛�${alt}km  鏂逛綅瑙掞細${heading}掳 淇话瑙掞細${pitch}掳 缈绘粴瑙掞細${roll}掳`;
+                console.log(pitch);
+                that.showFlyimg=pitch<-60? true:false;
+                // console.log(that.showFlyimg);
+              });
+            },
           });
-          let urldian1 =
+          let urldian1=
             "http://183.162.245.49:8099/geoserver/SHwuxiandian/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHwuxiandian:1GZ_POI&maxFeatures=50&outputFormat=application%2Fjson";
-          let urldian =
+          let urldian=
             "http://183.162.245.49:8099/geoserver/SHP/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=SHP:SH_POI1&maxFeatures=50&outputFormat=application%2Fjson";
           try {
-            loaddian(urldian1, "[TE_DESC]", "[height]");
-            loaddian(urldian, "[name]", "[Height]");
+            loaddian(urldian1,"[TE_DESC]","[height]");
+            loaddian(urldian,"[name]","[Height]");
             loadBaimo(1);
             loadLW();
             addRightMouseEvent();
             SPPM();
             loadYH();
-            juhe(true, "鐩戞祴绔�");
+            juhe(true,"鐩戞祴绔�");
             addMpt(true);
-          } catch (error) {}
+          } catch(error) { }
           //寮�鍚棩鐓�
-          viewer.scene.globe.enableLighting = false;
-          viewer.shadows = false;
+          viewer.scene.globe.enableLighting=false;
+          viewer.shadows=false;
           addMouseEvent();
           light();
           getVectorList().then((res) => {
-            if (res.message === "Success") {
-              let region = res.rows;
+            if(res.message==="Success") {
+              let region=res.rows;
               region.forEach((item) => {
-                let arr = [];
+                let arr=[];
                 JSON.parse(item.vlatlngs).forEach((item2) => {
-                  arr.push([item2[1], item2[0]]);
+                  arr.push([item2[1],item2[0]]);
                 });
-                item.vlatlngs = JSON.stringify(arr);
+                item.vlatlngs=JSON.stringify(arr);
               });
-              bus.$emit("areaData", region);
+              bus.$emit("areaData",region);
             }
           });
           //鑾峰彇鏃犵嚎鐢垫暟鎹�
           getRadio().then((res) => {
-            if (res.message === "Success") {
-              let radio = res.rows;
-              bus.$emit("radioData", radio);
+            if(res.message==="Success") {
+              let radio=res.rows;
+              bus.$emit("radioData",radio);
               console.log(radio);
             }
           });
@@ -147,34 +184,34 @@
           // window.Viewer.scene.primitives.add(baimo);
           //鍘垮煙杈圭晫,缃戞牸
         },
-        subClick(index) {
+        subClick (index) {
           let showindex;
-          switch (index) {
+          switch(index) {
             case 0:
-              showindex = 1;
+              showindex=1;
               break;
             case 1:
-              showindex = 2;
+              showindex=2;
               break;
             case 2:
-              showindex = 3;
+              showindex=3;
               break;
             case 3:
-              showindex = 4;
+              showindex=4;
               break;
             case 4:
-              showindex = 5;
+              showindex=5;
               break;
             default:
               break;
           }
-          bus.$emit("showindex", showindex);
+          bus.$emit("showindex",showindex);
         },
-        prop: [970, 970],
+        prop: [970,970],
         nav: {
           navTop: () => import("@/components/top/navTop"),
         },
-        showSub: true,
+        showSub: false,
         compss: [
           {
             sub: "棰戣氨鎬佸娍鍒嗘瀽", //缃戞牸绠$悊
@@ -238,17 +275,72 @@
           DynamicMap: () => import("@/components/props/bottom"), //鎬佸娍鍥惧姩鎬佹挱鏀�
           freeAnalyse: () => import("@/components/props/freeAnalyse"), //绌洪棽璧勬簮灞曠ず
           moreTZ: () => import("@/components/props/moreTZ"), //绌洪棽璧勬簮灞曠ず
+          // SurprisePlus
+          showMilitaryPlot: () => import("@/components/props/militaryPlot"), //鍐涗簨鏍囩粯
+          situationComparison: () =>
+            import("@/components/props/situationComparison"), //鎬佸娍瀵规瘮
+          occupancyAnalysis: () =>
+            import("@/components/props/occupancyAnalysis"), //棰戣氨鍗犵敤搴﹀垎鏋�
+
+          densityAnalysis: () => import("@/components/props/densityAnalysis"), //鐢ㄩ瀵嗗害鍒嗘瀽
+
+          SC1: () => import("@/components/props/situationComparison6-1"),
+          SC2: () => import("@/components/props/situationComparison6-2"),
+          SC3: () => import("@/components/props/situationComparison6-3"),
+          SC4: () => import("@/components/props/situationComparison6-4"),
+          SC5: () => import("@/components/props/situationComparison6-5"),
+          SC6: () => import("@/components/props/situationComparison6-6"),
+          SC7: () => import("@/components/props/situationComparison6-7"),
+          SC8: () => import("@/components/props/situationComparison7-1"),
+          SC9: () => import("@/components/props/situationComparison7-2-1"),
+          SC10: () => import("@/components/props/situationComparison7-3-1"),
+          SC11: () => import("@/components/props/situationComparison7-4"),
+          SC12: () => import("@/components/props/situationComparison7-5"),
+          SC13: () => import("@/components/props/situationComparison7-6"),
+          SC14: () => import("@/components/props/situationComparison7-7"),
+          SC15: () => import("@/components/props/situationComparison7-8"),
+          SC16: () => import("@/components/props/situationComparison7-9"),
+          SC17: () => import("@/components/props/situationComparison8-1"),
+          SC18: () => import("@/components/props/situationComparison8-2"),
+          SC19: () => import("@/components/props/situationComparison8-3"),
+          SC20: () => import("@/components/props/situationComparison8-4"),
+          SC21: () => import("@/components/props/situationComparison9-1"),
+          SC22: () => import("@/components/props/situationComparison9-2"),
+          SC23: () => import("@/components/props/situationComparison9-3"),
+          SC24: () => import("@/components/props/situationComparison10-1"),
+          SC25: () => import("@/components/props/situationComparison10-2"),
+          SC26: () => import("@/components/props/situationComparison10-3"),
+          SC27: () => import("@/components/props/situationComparison10-4"),
+          SC28: () => import("@/components/props/situationComparison7-10"),
+          SC29: () => import("@/components/props/situationComparison7-11"),
+          SC30: () => import("@/components/props/situationComparison7-12"),
+
+          SC31: () => import("@/components/props/militaryVIdeo"), //鍐涗簨鏍囩粯
+
         },
       });
     },
   },
-  mounted() {
+  mounted () {
     this.init();
   },
 };
 </script>
 
 <style>
+.imgbox {
+  position: absolute;
+  /* background-color: #fff; */
+  /* opacity: 0.2;. */
+  /* top:50px; */
+  width: 100%;
+  height: 500px;
+}
+img {
+  width: 100%;
+  height: 100%;
+  -webkit-user-drag: none;
+}
 #app1 {
   font-family: "Avenir", Helvetica, Arial, sans-serif;
   -webkit-font-smoothing: antialiased;

--
Gitblit v1.9.3