瀏覽代碼

修复回显没有线段的bug

yanglzh 2 年之前
父節點
當前提交
2dc874c5b5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/views/heating/heatStation/loop/component/edit.vue

+ 2 - 1
src/views/heating/heatStation/loop/component/edit.vue

@@ -359,7 +359,8 @@ export default defineComponent({
       })
     }
     function setLine(pointList: any[]) {
-      map.removeOverlay(polyline);
+      polyline && map.removeOverlay(polyline);
+      if (!pointList || !pointList.length) return
       polyline = new BMapGL.Polyline(pointList, { strokeColor: "blue", strokeWeight: 10, strokeOpacity: 0.5 });   //创建折线
       map.addOverlay(polyline);
     }