Browse Source

无人机取证点击上图

maxiaoxiao 4 tháng trước cách đây
mục cha
commit
ed3d3a34a0
1 tập tin đã thay đổi với 30 bổ sung11 xóa
  1. 30 11
      src/views/farmlandProtection/components/hcxx.vue

+ 30 - 11
src/views/farmlandProtection/components/hcxx.vue

@@ -62,7 +62,7 @@
           class="imgDiv"
           v-for="(item, i) in xsxList"
           :key="i"
-          @click="clickxsx(i)"
+          @click="clickxsx(item)"
         >
           <span>{{ i + 1 }}</span>
           <img :src="item.imagerPath" />
@@ -74,6 +74,7 @@
 
 <script>
 import { getJctbhcInfo, getTiffPath } from "@/api/ghss/jctb.js";
+import { loadGeoJSON } from "@/utils/MapHelper/help.js";
 export default {
   props: {
     detailObj: {
@@ -150,9 +151,32 @@ export default {
       this.$emit("updateParent", "emitImgList", this.monitorList);
       this.$emit("updateParent", "emitImgIndex", val);
     },
-    clickxsx(val) {
-      this.$emit("updateParent", "emitImgList", this.xsxList);
-      this.$emit("updateParent", "emitImgIndex", val);
+    //getEntities(id, url, position, type) {
+    clickxsx(item) {
+      let posArr = item.pngenvelope;
+
+      // 创建Cesium的ImageMaterialProperty
+      const imageMaterial = new Cesium.ImageMaterialProperty({
+        image: item.imagerPath,
+        repeat: new Cesium.Cartesian2(1.0, 1.0), // 控制图像重复,这里设置为不重复
+        transparent: true, // 如果图像有透明通道,设置为true
+      });
+      loadGeoJSON(this.detailObj.geom, "#ff0000", { isfly: true }, (data) => {
+        data.entities.add({
+          name: "Image Overlay",
+          id: "wrj",
+          rectangle: {
+            coordinates: Cesium.Rectangle.fromDegrees(
+              posArr[0],
+              posArr[1],
+              posArr[2],
+              posArr[3]
+            ), // 设置矩形的经纬度范围
+            material: imageMaterial,
+          },
+        });
+        layerSources["wrj"] = data;
+      });
     },
     // aaa() {
     //   var redLine = viewer.entities.add({
@@ -384,15 +408,9 @@ export default {
                     window.axiosURI +
                     "/file/upload/attachment" +
                     res.data.pngpath,
+                  pngenvelope: res.data.pngenvelope,
                 },
               ];
-              console.log(this.xsxList);
-              this.getEntities(
-                this.detailObj.jcbh,
-                res.data.pngpath,
-                res.data.pngenvelope,
-                2
-              );
             }
           });
         }
@@ -406,6 +424,7 @@ export default {
     this.delatePoi("dw");
     this.handler.destroy();
     this.handler = null;
+    viewer.dataSources.remove(layerSources["wrj"]);
   },
 };
 </script>