This commit is contained in:
parent
9400e5e138
commit
40f6fb590c
|
|
@ -708,6 +708,7 @@ export default {
|
|||
// 根据newPointList 中的type绘制线和半圆
|
||||
newPointList.forEach((item) => {
|
||||
if (item.type === 'line') {
|
||||
console.log(item, 'item画直线, ')
|
||||
const line = new BMapGL.Polyline(
|
||||
[
|
||||
new BMapGL.Point(item.start[0], item.start[1]),
|
||||
|
|
@ -724,18 +725,30 @@ export default {
|
|||
console.log('画半圆', item)
|
||||
// 绘制半圆弧线
|
||||
if (item.start_point && item.end_point && item.center && item.radius) {
|
||||
const arcPoints = this.generateArcPoints(
|
||||
item.center,
|
||||
item.radius,
|
||||
item.start_point,
|
||||
item.end_point,
|
||||
const line = new BMapGL.Polyline(
|
||||
[
|
||||
new BMapGL.Point(item.start_point[0], item.start_point[1]),
|
||||
new BMapGL.Point(item.end_point[0], item.end_point[1]),
|
||||
],
|
||||
{
|
||||
strokeColor: 'red',
|
||||
strokeWeight: 2,
|
||||
strokeOpacity: 0.8,
|
||||
},
|
||||
)
|
||||
const arcPolyline = new BMapGL.Polyline(arcPoints, {
|
||||
strokeColor: 'red',
|
||||
strokeWeight: 2,
|
||||
strokeOpacity: 0.8,
|
||||
})
|
||||
this.map.addOverlay(arcPolyline)
|
||||
this.map.addOverlay(line)
|
||||
// const arcPoints = this.generateArcPoints(
|
||||
// item.center,
|
||||
// item.radius,
|
||||
// item.start_point,
|
||||
// item.end_point,
|
||||
// )
|
||||
// const arcPolyline = new BMapGL.Polyline(arcPoints, {
|
||||
// strokeColor: 'red',
|
||||
// strokeWeight: 2,
|
||||
// strokeOpacity: 0.8,
|
||||
// })
|
||||
// this.map.addOverlay(arcPolyline)
|
||||
} else {
|
||||
// 如果没有起点和终点,则绘制完整圆(备用方案)
|
||||
const circle = new BMapGL.Circle(
|
||||
|
|
|
|||
Loading…
Reference in New Issue