riku
2024-08-23 1788c96aea9247cc36ef8b82734997f1a6a92fb4
src/utils/map/sector.js
@@ -109,7 +109,7 @@
function drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2) {
  if (distance == 0 || distance2 == 0) {
    return;
    return false;
  }
  // eslint-disable-next-line no-undef
  var sector = new AMap.Object3D.Mesh();
@@ -167,6 +167,7 @@
  }
  object3Dlayer.add(sector);
  _sector = sector;
  return true;
}
function drawTextMaker(list, list2, distance, distance2) {
@@ -247,13 +248,14 @@
   * @returns 数据坐标点和扇形最大半径
   */
  drawSector(fDatas, i) {
    if (_sector != undefined) {
      this.clearSector();
    }
    this.clearSector();
    const { sDeg, eDeg, lnglat, distance, distance2, list, list2 } =
      sectorParams(fDatas, i);
    drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2);
    drawElasticMarker(list, list2, distance, distance2);
    if (drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2)) {
      // 当风速大于0绘制了扇形时,才绘制对应的距离等文本标记
      // drawElasticMarker(list, list2, distance, distance2);
      drawTextMaker(list, list2, distance, distance2);
    }
    return { p: lnglat, r: distance };
  },
@@ -266,7 +268,8 @@
    this.clearSectorMesh();
    const { sDeg, eDeg, lnglat, distance, distance2, list, list2 } =
      sectorParams(fDatas, i);
    drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2);
    drawTextMaker(list, list2, distance, distance2);
    if (drawSectorMesh(sDeg, eDeg, lnglat, distance, distance2)) {
      drawTextMaker(list, list2, distance, distance2);
    }
  }
};