liuyg
2022-01-10 5b14c0f3e3bbbd992a87fb6d0a49baee17659cc6
+不每次都移动到起点
2 files modified
19 ■■■■ changed files
src/components/mobileWindow/index.vue 1 ●●●● patch | view | raw | blame | history
src/store/modules/mobile.js 18 ●●●● patch | view | raw | blame | history
src/components/mobileWindow/index.vue
@@ -224,6 +224,7 @@
              //加载第一条线路
              that.$store.commit("set_choiceRouterS", 0);
              that.$store.dispatch("MSET_DRAWALINELAYER", datas.Str);
              that.$store.commit("cameraSetView", ints.start);
            }
          },
        };
src/store/modules/mobile.js
@@ -720,18 +720,32 @@
    MSET_DRAWALINELAYER({ state, commit, dispatch }, Str) {
      //检查是否存在路线
      commit("removePolyline");
      // let color = global.DC.Color.RED;
      // let color = global.DC.Namespace.Cesium.Color.DEEPSKYBLUE;
      let color =
        global.DC.Namespace.Cesium.Color.fromCssColorString("#409EFF");
      // let color = {
      //   alpha: 1,
      //   blue: 0,
      //   green: 0,
      //   red: 1,
      // };
      // color.blue = 0.25;
      // color.green = 0.61;
      // color.red = 1;
      // console.log(color);
      let drawALineLayer = new global.DC.VectorLayer("layer");
      state.mviewer.addLayer(drawALineLayer);
      let polyline = new global.DC.Polyline(Str); //加入绘画点
      polyline.setStyle({
        width: 3,
        material: DC.Color.RED,
        material: color,
        clampToGround: true,
      });
      drawALineLayer.addOverlay(polyline);
      state.drawALineLayer = drawALineLayer;
      state.isOpenDrawALine = true;
      commit("cameraSetView", state.navigationStartLngLat); //移动
      // commit("cameraSetView", state.navigationStartLngLat); //移动
    },
  },
};