Methods
-
cancel(fn)
-
取消绘制模式
Parameters:
Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式
-
finish(withOffset, fn)
-
绘制结束。调用此方法会结束当前的绘制,并在回调函数中返回绘制类型和坐标点,然后根据这些坐标点再创建相关的几何图形。
Parameters:
Name Type Description withOffsetboolean 是否计算工程中心偏移,默认值是true
fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式
Example
let res = await fdapi.editHelper.finish(true); switch (res.buildType) { case 0: { fdapi.polyline.add({ id: Math.random(), coordinates: res.coordinates, color: Color.Red, style: 2, thickness: 10, intensity: 1, flowRate: 0.5, }); } break; case 1: { fdapi.polygon.add({ id: Math.random(), color: Color.Blue, coordinates: res.coordinates, frameColor: Color.Red, frameThickness: 1 }); } break; } -
setParam(lineType, buildType, color, fn)
-
设置绘制参数
Parameters:
Name Type Description lineTypenumber 线类型,0:直线,1:曲线,默认值是0
buildTypenumber 绘制类型,0:画多点线段, 1:画多边形, 默认值是0
colorColor 颜色,支持四种格式,取值示例
fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式
-
start(fn)
-
进入绘制模式
Parameters:
Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式
