修改批量模型绘制

This commit is contained in:
2025-08-21 17:00:34 +08:00
parent 4f57ac3d9e
commit ea80fe325c

View File

@ -107,16 +107,22 @@ class BatchModel extends Base {
// posiArr = [that.options.positions] // posiArr = [that.options.positions]
that.pointArr = posiArr that.pointArr = posiArr
} }
posiArr.forEach((item, index) => { let params = {
let model = new Model(that.sdk, { type: that.options.type,
id: 'model' + index, positions: posiArr,
show: that.options.show, rotate: that.options.type == '点' ? undefined : array[1]
url: that.options.url, }
position: item, that.callback(params)
rotate: that.options.type == '点' ? undefined : { x: 0, y: 0, z: array[1] && (array[1][index] || array[1]) } // posiArr.forEach((item, index) => {
}) // let model = new Model(that.sdk, {
that.pointArr.push(model) // id: 'model' + index,
}) // show: that.options.show,
// url: that.options.url,
// position: item,
// rotate: that.options.type == '点' ? undefined : { x: 0, y: 0, z: array[1] && (array[1][index] || array[1]) }
// })
// that.pointArr.push(model)
// })
} }
async linePoint(polygonPositions, spacing) { async linePoint(polygonPositions, spacing) {
let boundaryPoints = []; let boundaryPoints = [];
@ -399,8 +405,8 @@ class BatchModel extends Base {
break; break;
} }
Draw && Draw.start((a, positions) => { Draw && Draw.start((a, positions) => {
this.options.positions = positions this.options.positions = positions;
this.callback(this.options); // this.callback(this.options);
(this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this) (this.options.positions.length || this.options.positions.lng) && BatchModel.computeDis(this)
}) })