Compare commits

..

3 Commits

Author SHA1 Message Date
zh
9f35d752c2 修复扇形二次编辑时标注未贴合实体的问题 2025-08-14 15:56:34 +08:00
zh
22f9693957 二三维 2025-08-14 15:55:52 +08:00
zh
e022aa5ef1 解决贴地图片修改文字不生效的问题 2025-08-14 15:54:14 +08:00
4 changed files with 34 additions and 4 deletions

View File

@ -231,7 +231,11 @@ async function syncData2(sdk, id, entityId) {
if (obj.showView == 3) {
options.show = false
}
let target = await new obj.constructor(sdk2D, options)
let target = await sdk2D.entityMap.get(options.id)
if(target) {
await target.remove()
}
target = await new obj.constructor(sdk2D, options)
target.onClick = obj.onClick
target.onRightClick = obj.onRightClick
target.onMouseMove = obj.onMouseMove

View File

@ -81,6 +81,16 @@ class GroundImage extends Base {
this.create()
}
get name() {
return this.options.name
}
set name(v) {
super.name = v
this.options.label.text = this.options.name
this.entity && (this.entity.label.text = this.options.label.text)
}
get mode() {
return this.options.mode
}

View File

@ -1526,6 +1526,9 @@ class GroundSvg extends Base {
controlPoints[9] = turf.destination(point, wh, 0 + angle, options).geometry.coordinates
this.controlPoints = controlPoints
if(!this.sdk || !this.sdk.viewer) {
return
}
for (let i = 0; i < this.controlPoints.length; i++) {
let color = '#00ff0a'
if (i === 5) {

View File

@ -293,7 +293,7 @@ class SectorObject extends Base {
return this.options.line.width
}
set lineWidth(v) {
this.options.line.width = ((v || v === 0) ? v : 3)
this.options.line.width = ((v || v === 0) ? v : 3)
this.entity.polyline.width = this.options.line.width
this._elms.lineWidth && this._elms.lineWidth.forEach((item) => {
item.value = this.options.line.width
@ -1560,7 +1560,7 @@ class SectorObject extends Base {
_addRr() {
if (this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value) {
this.options.attribute.vr.content.push({
name: '全景图' ,
name: '全景图',
url: this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value
})
this._DialogObject._element.content.getElementsByClassName('vr_add')[0].value = ''
@ -1573,7 +1573,7 @@ class SectorObject extends Base {
addAttributeRr(vr) {
this.options.attribute.vr.content.push({
name: '全景图' ,
name: '全景图',
url: vr
})
this.attributeVr = this.options.attribute.vr.content
@ -1922,6 +1922,19 @@ class SectorObject extends Base {
that.cartesian3Towgs84(positions[1], that.sdk.viewer),
that.cartesian3Towgs84(positions[positions.length - 4], that.sdk.viewer)
]
let objectsToExclude = [...that.sdk.viewer.entities.values]
that
.getClampToHeight({
lng: that.options.center.lng,
lat: that.options.center.lat
}, objectsToExclude)
.then(height => {
that.label.position = [
that.options.center.lng,
that.options.center.lat,
height
]
})
setTimeout(() => {
createNodePoints(positions[1], 'sector-start')
createNodePoints(positions[positions.length - 4], 'sector-end')