From f407a40f1705e30c53d1d4a024e84fc91ea96c9d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 17 Jan 2022 17:09:55 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/school-web

---
 public/img/dingwei/dingwei1.png                |    0 
 src/components/mobileCloseRouter/index.vue     |    1 
 src/store/modules/mobile.js                    |   77 +++++++++++++++++++++++---------------
 src/components/mobileCloseRouterMany/index.vue |   21 +++++++++-
 public/img/dingwei/dingwei.png                 |    0 
 5 files changed, 66 insertions(+), 33 deletions(-)

diff --git a/public/img/dingwei/dingwei.png b/public/img/dingwei/dingwei.png
new file mode 100644
index 0000000..b25524b
--- /dev/null
+++ b/public/img/dingwei/dingwei.png
Binary files differ
diff --git a/public/img/dingwei/dingwei1.png b/public/img/dingwei/dingwei1.png
new file mode 100644
index 0000000..3f5cb10
--- /dev/null
+++ b/public/img/dingwei/dingwei1.png
Binary files differ
diff --git a/src/components/mobileCloseRouter/index.vue b/src/components/mobileCloseRouter/index.vue
index a068e0b..8efd9d1 100644
--- a/src/components/mobileCloseRouter/index.vue
+++ b/src/components/mobileCloseRouter/index.vue
@@ -54,6 +54,7 @@
   methods: {
     mobileRouterClose() {
       this.$store.commit("removePolyline");
+      this.$store.commit("removerPolyLineIcon");
     },
     mobileRouterCloseOpen(Str, index) {
       if (this.choiceRouterS == index) {
diff --git a/src/components/mobileCloseRouterMany/index.vue b/src/components/mobileCloseRouterMany/index.vue
index 47186ad..437269a 100644
--- a/src/components/mobileCloseRouterMany/index.vue
+++ b/src/components/mobileCloseRouterMany/index.vue
@@ -4,6 +4,15 @@
     <div
       :class="[
         'mobileCloseRouterMany',
+        'mobileCloseRouterManyupTitle',
+        isOpenDrawALineMany ? 'mobileCloseActiveMany' : '',
+      ]"
+    >
+      {{ isOpenDrawALineMany }}
+    </div>
+    <div
+      :class="[
+        'mobileCloseRouterMany',
         isOpenDrawALineMany ? 'mobileCloseActiveMany' : '',
       ]"
       @click="mobileRouterCloseMany"
@@ -34,9 +43,10 @@
     ...mapGetters(["isOpenDrawALineMany"]),
   },
   // data() {
-  //   return {
+  // return {
+  // title: "",
   //     lengthS: 0,
-  //   };
+  // };
   // },
   // watch: {
   // isOpenDrawALine() {
@@ -73,6 +83,13 @@
   width: 0;
   height: 0;
 }
+.mobileCloseRouterManyupTitle {
+  bottom: 353px !important;
+  background-color: #fff !important;
+  color: #000 !important;
+  width: auto !important;
+  padding: 0 10px;
+}
 .mobileCloseRouterMany {
   position: fixed;
   width: 105px;
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 0a816df..d747e5a 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -56,6 +56,7 @@
     navigationStartLngLat: "", //导航起点
     navigationEndLngLat: "", //导航终点
     drawALineLayer: null, //导航路径图层
+    drawALineLayerIcon: null, //导航路径图层图标
     isOpenDrawALine: false, //是否开启路径
     endPosition: "", //传送终点经纬度--
     isendPosition: false, //传送终点经纬度--感应数据
@@ -270,6 +271,12 @@
         state.isOpenDrawALine = false;
       }
     },
+    removerPolyLineIcon(state) {
+      if (state.drawALineLayerIcon) {
+        state.drawALineLayerIcon.remove();
+        state.drawALineLayerIcon = null;
+      }
+    },
     removePolylineMany(state) {
       if (state.drawALineLayerMany) {
         state.drawALineLayerMany.remove();
@@ -302,7 +309,7 @@
       const nowHeight = Math.ceil(
         state.mviewer.camera.positionCartographic.height
       );
-      console.log(data);
+      // console.log(data);
       if (state.dimension == "3D") {
         Flys = [
           +data.lntLat[0] + 0.01197,
@@ -744,22 +751,19 @@
         color: color,
         speed: 10,
       });
-      let drawALineLayer = new global.DC.VectorLayer("layer");
-      state.mviewer.addLayer(drawALineLayer);
-      let polyline = new global.DC.Polyline(Str); //加入绘画点
-      polyline.setStyle({
-        width: 3,
-        material: material,
-        clampToGround: true,
-      });
-      drawALineLayer.addOverlay(polyline);
+      state.drawALineLayer = new global.DC.VectorLayer("lineLayer");
+      state.mviewer.addLayer(state.drawALineLayer);
+
       //如果是添加  给第一个点加入图标 和事件
       if (value[1]) {
+        commit("removerPolyLineIcon");
+        state.drawALineLayerIcon = new global.DC.VectorLayer("pointLayer");
+        state.mviewer.addLayer(state.drawALineLayerIcon);
         let post = Str.split(";")[0].split(",");
         let position = new global.DC.Position(post[0], post[1]);
         let billboard = new global.DC.Billboard(
           position,
-          "img/dingwei/dingwei4.png"
+          "img/dingwei/dingwei1.png"
         ); //加入绘画点
         billboard.setStyle({
           pixelOffset: { x: 0, y: -17 }, //偏移像素
@@ -779,10 +783,16 @@
           };
           dispatch("setMobileWindows", windowData);
         });
-        drawALineLayer.addOverlay(billboard);
+        state.drawALineLayerIcon.addOverlay(billboard);
       }
+      let polyline = new global.DC.Polyline(Str); //加入线
+      polyline.setStyle({
+        width: 3,
+        material: material,
+        clampToGround: true,
+      });
+      state.drawALineLayer.addOverlay(polyline);
 
-      state.drawALineLayer = drawALineLayer;
       state.isOpenDrawALine = true;
       // commit("cameraSetView", state.navigationStartLngLat); //移动
     },
@@ -799,30 +809,36 @@
         color: red,
         speed: 10,
       });
-      let drawALineLayerMany = new global.DC.VectorLayer("layer");
+      let material1 = new global.DC.PolylineImageTrailMaterialProperty({
+        color: global.DC.Color(255, 0, 0),
+        speed: 60,
+        image: "img/icon/right.png",
+        repeat: { x: 320, y: 1 },
+      });
+      let drawALineLayerMany = new global.DC.VectorLayer("manyLinePointLayer");
       state.mviewer.addLayer(drawALineLayerMany);
       //多条线
       for (let k in Strs) {
         let polyline = new global.DC.Polyline(Strs[k].value); //加入绘画点
         polyline.setStyle({
           width: 3,
-          material: material,
+          material: material1,
           clampToGround: true,
         });
         drawALineLayerMany.addOverlay(polyline);
-        let post = Strs[k].value.split(";")[0].split(",");
-        let position = new global.DC.Position(post[0], post[1]);
-        let Label = new global.DC.Label(position, Strs[k].name);
-        Label.setStyle({
-          font: "16px sans-serif", // CSS 字体设置
-          scale: 1, //比例
-          fillColor: white, //文字颜色
-          showBackground: true, //是否显示背景
-          backgroundColor: blue, //背景颜色
-          // outlineColor: white, //边框颜色
-          // outlineWidth: 10, //边框大小,
-        });
-        drawALineLayerMany.addOverlay(Label);
+        // let post = Strs[k].value.split(";")[0].split(",");
+        // let position = new global.DC.Position(post[0], post[1]);
+        // let Label = new global.DC.Label(position, Strs[k].name);
+        // Label.setStyle({
+        //   font: "16px sans-serif", // CSS 字体设置
+        //   scale: 1, //比例
+        //   fillColor: white, //文字颜色
+        //   showBackground: true, //是否显示背景
+        //   backgroundColor: blue, //背景颜色
+        //   // outlineColor: white, //边框颜色
+        //   // outlineWidth: 10, //边框大小,
+        // });
+        // drawALineLayerMany.addOverlay(Label);
       }
       //多个点
       let point = value[1];
@@ -832,7 +848,7 @@
 
         let billboard = new global.DC.Billboard(
           position,
-          "img/dingwei/dingwei4.png"
+          "img/dingwei/dingwei1.png"
         ); //加入绘画点
         billboard.setStyle({
           pixelOffset: { x: 0, y: -17 }, //偏移像素
@@ -882,9 +898,8 @@
         drawALineLayerMany.addOverlay(Labels);
         // console.log(point[k]);
       }
-
       state.drawALineLayerMany = drawALineLayerMany;
-      state.isOpenDrawALineMany = true;
+      state.isOpenDrawALineMany = value[2].name ? value[2].name : true;
       // commit("cameraSetView", state.navigationStartLngLat); //移动
     },
   },

--
Gitblit v1.9.3