Browse Source

问题修改

sunzehao 2 months ago
parent
commit
4af2f6377c
2 changed files with 8 additions and 22 deletions
  1. 3 0
      package.json
  2. 5 22
      src/views/cesium.vue

+ 3 - 0
package.json

@@ -18,6 +18,9 @@
     "dayjs": "^1.11.13",
     "echarts": "^6.0.0",
     "element-plus": "^2.10.6",
+    "gifler": "^0.1.0",
+    "gifuct-js": "^2.1.2",
+    "js-binary-schema-parser": "^2.0.3",
     "js-cookie": "^3.0.5",
     "three": "^0.179.1",
     "three-obj-mtl-loader": "^1.0.3",

+ 5 - 22
src/views/cesium.vue

@@ -261,7 +261,6 @@ export default {
   mounted() {
     this.initEventListener();
     this.initCesium();
-    // this.initCesiums()
     if (this.showDevInfoBox) {
       this.initSystemInfo();
     }
@@ -341,21 +340,6 @@ export default {
       });
     },
 
-    initCesiums() {
-      const viewer = new Cesium.Viewer("cesiumContainer", {
-        baseLayerPicker: false, // 禁用默认图层选择器
-      });
-
-      // 创建自定义影像图层
-      const customImageryProvider = new Cesium.UrlTemplateImageryProvider({
-        url: output, // 替换为你的图片路径
-        maximumLevel: 0, // 图片为单层,无需缩放
-      });
-
-      // 将自定义图层设置为地球的底图
-      viewer.imageryLayers.addImageryProvider(customImageryProvider);
-    },
-
     // 初始化地球
     async initCesium() {
       // 需要从 https://cesium.com/ion/signup 获取
@@ -431,7 +415,6 @@ export default {
       this.viewer = viewer;
 
       // this.setMapImageryProvider();
-
       this.switchWindLayer();
       this.showAllStation(viewer);
       this.initGeoJsonData();
@@ -920,7 +903,7 @@ export default {
 
         this.labelLayer = labelLayer;
         // this.csceneElliposid(this.viewer, null)
-        this.resetViewport1();
+        // this.resetViewport1();
       });
     },
     initresetViewport() {
@@ -984,7 +967,7 @@ export default {
         destination: Cesium.Cartesian3.fromDegrees(
           106.169866,
           38.46637,
-          5000000
+          height
         ),
         // orientation: {
         //   heading: 1,
@@ -1371,7 +1354,7 @@ export default {
         this.removeTemperatureLayer();
         this.stopCycling(this.tempintervalId);
       }
-      if (!val && (this.cloudLayer || this.cloudImagesLayer.length > 0)) {
+      if (!val || this.cloudLayer || this.cloudImagesLayer.length > 0) {
         this.removeCloudLayer();
         this.stopCycling(this.cloudintervalId);
       } else {
@@ -1549,7 +1532,7 @@ export default {
           this.showStationFn(viewer, e, index, gf);
         }
       });
-      this.resetViewport(5000000);
+    //   this.resetViewport(6000000);
     },
     // 根据状态展示不同颜色风机贴图
     async showStationFn(viewer, e, index, images) {
@@ -1962,7 +1945,7 @@ export default {
     backStations() {
       this.showWindDetail = false;
       this.showTypeViewer = true;
-      this.switchWindLayer(true);
+      this.switchWindLayer();
       this.allWindEntitys.forEach(({ entity, handler }) => {
         this.viewer.entities.remove(entity); // 移除实体
         if (!handler.isDestroyed()) {