shuishen
2022-01-17 f407a40f1705e30c53d1d4a024e84fc91ea96c9d
Merge branch 'master' of http://192.168.0.105:10010/r/school-web
3 files modified
2 files added
95 ■■■■■ changed files
public/img/dingwei/dingwei.png patch | view | raw | blame | history
public/img/dingwei/dingwei1.png patch | view | raw | blame | history
src/components/mobileCloseRouter/index.vue 1 ●●●● patch | view | raw | blame | history
src/components/mobileCloseRouterMany/index.vue 17 ●●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 77 ●●●●● patch | view | raw | blame | history
public/img/dingwei/dingwei.png
public/img/dingwei/dingwei1.png
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) {
src/components/mobileCloseRouterMany/index.vue
@@ -4,6 +4,15 @@
    <div
      :class="[
        'mobileCloseRouterMany',
        'mobileCloseRouterManyupTitle',
        isOpenDrawALineMany ? 'mobileCloseActiveMany' : '',
      ]"
    >
      {{ isOpenDrawALineMany }}
    </div>
    <div
      :class="[
        'mobileCloseRouterMany',
        isOpenDrawALineMany ? 'mobileCloseActiveMany' : '',
      ]"
      @click="mobileRouterCloseMany"
@@ -35,6 +44,7 @@
  },
  // data() {
  //   return {
  // title: "",
  //     lengthS: 0,
  //   };
  // },
@@ -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;
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); //移动
    },
  },