参考画圆的步骤是首先定义画多边形的样式
let dragArea = this._tool.polygon()
// 设置 fill 样式
.fill({ color: ‘rgba(0,128,255,0.2)’ })
// 设置点击区域,这里设置的是根据 fill 模式点击
.style(‘pointer-events’, ‘fill’)
// 设置鼠标样式
.style(‘cursor’, ‘move’);
接下来要定义绘画函数
this._tool.plot = (points, position) => {
this._tool.move(position.x, position.y);
dragArea.points(points); // 我的问题就在这里,提示points不是一个方法,这个地方应该用什么呢?
};
江湖救急,成分感谢!
试了一下plot搞定