This commit is contained in:
zh
2025-12-17 18:06:13 +08:00
parent 61f93a81f2
commit 27543a3eae
18 changed files with 146 additions and 117 deletions

View File

@ -1731,6 +1731,7 @@ class PolygonObject extends Base {
let added = false
let leftEvent = async (movement, cartesian) => {
let objectsToExclude = [...this.sdk.viewer.entities.values]
if (selectPoint) {
this.options.positions[selectPoint.index] = this.cartesian3Towgs84(
cartesian,
@ -1739,7 +1740,7 @@ class PolygonObject extends Base {
originalPosition = this.options.positions[selectPoint.index]
added = true
let potHeight = await this.getClampToHeight(
this.options.positions[selectPoint.index]
this.options.positions[selectPoint.index], objectsToExclude
)
let entity = this.sdk.viewer.entities.add({
name: 'node-secondary-edit-point',
@ -1773,7 +1774,6 @@ class PolygonObject extends Base {
)
newpositions = Cesium.Cartesian3.fromDegreesArray(fromDegreesArray)
let objectsToExclude = [...this.sdk.viewer.entities.values]
if (this.options.positions.length < 3) {
this
.getClampToHeight({
@ -1966,7 +1966,8 @@ class PolygonObject extends Base {
])
let polygon = turf.polygon(positions)
let centroid = turf.centroid(polygon)
this
setTimeout(() => {
this
.getClampToHeight({
lng: centroid.geometry.coordinates[0],
lat: centroid.geometry.coordinates[1]
@ -1978,6 +1979,7 @@ class PolygonObject extends Base {
height
]
})
}, 200);
}
setTimeout(() => {