diff --git a/src/Obj/Base/SectorObject/index.js b/src/Obj/Base/SectorObject/index.js index 6d306bc..66e9c1e 100644 --- a/src/Obj/Base/SectorObject/index.js +++ b/src/Obj/Base/SectorObject/index.js @@ -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')