This commit is contained in:
BianLzhaoMin 2025-11-21 09:54:31 +08:00
parent 9400e5e138
commit 40f6fb590c
1 changed files with 24 additions and 11 deletions

View File

@ -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(