diff --git a/src/Obj/Base/BatchModel/index.js b/src/Obj/Base/BatchModel/index.js index af82c3a..d61e6cd 100644 --- a/src/Obj/Base/BatchModel/index.js +++ b/src/Obj/Base/BatchModel/index.js @@ -47,8 +47,30 @@ class BatchModel extends Base { this.pointArr = [] this.sdk.addIncetance(this.options.id, this) // BatchModel.computeDis(this) - if (this.options.positions.length > 0 || this.options.positions.lng) { - BatchModel.computeDis(this) + // if (this.options.positions.length > 0 || this.options.positions.lng) { + if (options.type && options.spacing != undefined) { + // BatchModel.computeDis(this) + + let Draw + switch (options.type) { + case '点': + Draw = new DrawPoint(this.sdk) + break; + case '线': + Draw = new DrawPolyline(this.sdk) + break; + case '面': + Draw = new DrawThreeRect(this.sdk) + break; + default: + break; + } + Draw && Draw.start((a, positions) => { + this.options.positions = positions; + // this.callback(this.options); + (this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this) + }) + } else { this.edit(true) }