2 Komitmen 5263fd1939 ... 75bf0b0b0a

Pembuat SHA1 Pesan Tanggal
  wangzhe 75bf0b0b0a Merge remote-tracking branch 'origin/master' 8 bulan lalu
  wangzhe 1126504c2f 路线规划 测试 去后台报错信息 8 bulan lalu
1 mengubah file dengan 13 tambahan dan 2 penghapusan
  1. 13 2
      screen-demo/src/views/templateInstance.vue

+ 13 - 2
screen-demo/src/views/templateInstance.vue

@@ -12,9 +12,10 @@
       :extraOptions="extraOptions"
       :center="[113.27243, 23.13795]"
     >
-      <div slot="layerSwitcher">
+      <div slot="layerSwitcher" v-if="mapInstance">
         <!-- 地图图层切换组件 -->
         <mapol-layer-switcher
+          v-if="mapInstance"
           :show="show"
           ref="switcher"
           :map="map"
@@ -167,7 +168,7 @@ export default {
       targetId: "", // 渲染地图ID
       mapType: "satellite", // 默认地图图层类型
       map: {}, // 地图实例
-      mapInstance: {}, // 地图实例
+      mapInstance: null, // 地图实例
       show: false, // 控制地图工具显示
       customStyle: {
         // 缩放控制器自定义样式
@@ -1845,6 +1846,16 @@ export default {
       this.map = e;
       this.targetId = targetId;
       this.mapInstance = e?.map || e;
+
+      // 导航 路线规划
+      let option = {
+        width: '8',
+        color: '#f40'
+      };
+      let toolRoute = new CTMapOl.extend.ToolRoute(e.map, option);
+      toolRoute.route([125,43], [125.8,43.8]).then(data => {
+        toolRoute.drawPath(data.routs)
+      })
       // 获取摄像头点位列表信息
       this.$requestSDK(
         "/jilin-devloper/jilin/querySiteCodeAndDevices",