| | |
| | | |
| | | 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(); |
| | |
| | | } |
| | | object3Dlayer.add(sector); |
| | | _sector = sector; |
| | | return true; |
| | | } |
| | | |
| | | function drawTextMaker(list, list2, distance, distance2) { |
| | |
| | | * @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 }; |
| | | }, |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | | }; |