quanyawei
2024-05-13 08633f23e4955c7e5f79d19912741cc22ef3f1e0
src/views/list/road.vue
@@ -386,16 +386,24 @@
  }
  // 显示所有矩形
  showAllPolygon() {
    console.log("this.dataSource", this.dataSource);
    this.dataSource.forEach((item: any) => {
      if (item.bdValues) {
        let pointList = item.bdValues.map((item: any) => {
          return new BMapGL.Point(item.lng, item.lat);
        });
        let polygon = new BMapGL.Polygon([...pointList]);
        console.log("polygon", polygon);
        this.map.addOverlay(polygon);
      }
    let macType = null;
    if (this.carvalue !== "请选择走航车") {
      macType = this.carvalue;
    }
    get("coordinate/selectCruiserRoad", {
      name: this.selectLuName,
      mac: macType,
    }).then((res) => {
      res.data.data.forEach((item: any) => {
        if (item.bdValues) {
          let pointList = item.bdValues.map((item: any) => {
            return new BMapGL.Point(item.lng, item.lat);
          });
          let polygon = new BMapGL.Polygon([...pointList]);
          console.log("polygon", polygon);
          this.map.addOverlay(polygon);
        }
      });
    });
  }
  // 显示矩形