Explorar el Código

修复回显没有线段的bug

yanglzh hace 2 años
padre
commit
2dc874c5b5
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  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);
     }