Procházet zdrojové kódy

修复回显没有线段的bug

yanglzh před 2 roky
rodič
revize
2dc874c5b5

+ 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);
     }