This commit is contained in:
zh
2025-12-19 12:34:25 +08:00
parent 8025e1c261
commit 5332767287
32 changed files with 330 additions and 45 deletions

View File

@ -1295,6 +1295,8 @@ class PolygonObject extends Base {
this.positions[0],
this.positions[1]
]
syncData(this.sdk, this.options.id)
syncSplitData(this.sdk, this.options.id)
}
/**
@ -1858,6 +1860,21 @@ class PolygonObject extends Base {
}
}
let rightEvent = (movement, cartesian) => {
this.closeNodeEdit = () => {
if (!this.sdk || !this.sdk.viewer) {
return
}
YJ.Measure.SetMeasureStatus(false)
this.event && this.event.destroy()
this.tip && this.tip.destroy()
this.tip = null
for (let i = 0; i < this.nodePoints.length; i++) {
this.sdk.viewer.entities.remove(this.nodePoints[i])
}
this.nodePoints = []
this.picking = true
}
if (selectPoint) {
this.options.positions[selectPoint.index] = originalPosition
// this.options.positions.splice(selectPoint.index, 1)
@ -1918,6 +1935,8 @@ class PolygonObject extends Base {
this.heightMode = this.heightMode
}
this.closeNodeEdit = rightEvent
this.entity.polyline.clampToGround = true
this.entity.polyline.arcType = Cesium.ArcType.GEODESIC
@ -1968,17 +1987,17 @@ class PolygonObject extends Base {
let centroid = turf.centroid(polygon)
setTimeout(() => {
this
.getClampToHeight({
lng: centroid.geometry.coordinates[0],
lat: centroid.geometry.coordinates[1]
}, objectsToExclude)
.then(height => {
this.label.position = [
centroid.geometry.coordinates[0],
centroid.geometry.coordinates[1],
height
]
})
.getClampToHeight({
lng: centroid.geometry.coordinates[0],
lat: centroid.geometry.coordinates[1]
}, objectsToExclude)
.then(height => {
this.label.position = [
centroid.geometry.coordinates[0],
centroid.geometry.coordinates[1],
height
]
})
}, 200);
}
@ -2066,7 +2085,7 @@ class PolygonObject extends Base {
}
}
this.nodePoints.pop()
if(this.options.positions.length < 3) {
if (this.options.positions.length < 3) {
this.tip.set_text('左键单击确定控制点位置,右键单击取消编辑! CTRL+右键单击撤销上一个控制点')
}
}