解决二三维快速切换贴地svg显隐报错的问题
This commit is contained in:
@ -13,6 +13,7 @@ import MouseTip from '../../../MouseTip'
|
||||
import Controller from '../../../Controller/index'
|
||||
import { syncData } from '../../../Global/MultiViewportMode'
|
||||
import { legp } from '../../Element/datalist'
|
||||
import { getFontList, getFontFamilyName } from '../../Element/fontSelect'
|
||||
import { setSplitDirection, syncSplitData, setActiveId } from '../../../Global/SplitScreen'
|
||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global'
|
||||
|
||||
@ -82,6 +83,7 @@ class PolylineObject extends Base {
|
||||
options.label.fontSize || options.label.fontSize === 0
|
||||
? options.label.fontSize
|
||||
: 20,
|
||||
fontFamily: options.label.fontFamily ? options.label.fontFamily : 0,
|
||||
color: options.label.color || '#ffffff',
|
||||
lineWidth:
|
||||
options.label.lineWidth || options.label.lineWidth === 0
|
||||
@ -693,6 +695,21 @@ class PolylineObject extends Base {
|
||||
})
|
||||
}
|
||||
|
||||
get labelFontFamily() {
|
||||
return this.options.label.fontFamily
|
||||
}
|
||||
|
||||
set labelFontFamily(v) {
|
||||
this.options.label.fontFamily = v || 0
|
||||
this.label && (this.label.fontFamily = this.options.label.fontFamily)
|
||||
|
||||
let name = getFontFamilyName(this.labelFontFamily) || ''
|
||||
this._elms.labelFontFamily &&
|
||||
this._elms.labelFontFamily.forEach(item => {
|
||||
item.value = name
|
||||
})
|
||||
}
|
||||
|
||||
get labelColor() {
|
||||
return this.options.label.color
|
||||
}
|
||||
@ -1289,6 +1306,7 @@ class PolylineObject extends Base {
|
||||
],
|
||||
text: that.options.name,
|
||||
fontSize: that.options.label.fontSize,
|
||||
fontFamily: that.options.label.fontFamily,
|
||||
color: that.options.label.color,
|
||||
pixelOffset: that.options.label.pixelOffset,
|
||||
backgroundColor: that.options.label.backgroundColor,
|
||||
@ -2147,6 +2165,37 @@ class PolylineObject extends Base {
|
||||
this._elms.altInput.push(altInput)
|
||||
tBodyElm.appendChild(tr)
|
||||
}
|
||||
|
||||
|
||||
let fontData = getFontList()
|
||||
let fontObject = legp(
|
||||
this._DialogObject._element.content.getElementsByClassName(
|
||||
'font-select-box'
|
||||
)[0],
|
||||
'.font-select'
|
||||
)
|
||||
if (fontObject) {
|
||||
fontObject.legp_search(fontData)
|
||||
let fontDataLegpElm = this._DialogObject._element.content
|
||||
.getElementsByClassName('font-select')[0]
|
||||
.getElementsByTagName('input')[0]
|
||||
fontDataLegpElm.value = fontData[this.labelFontFamily].value
|
||||
for (let i = 0; i < fontData.length; i++) {
|
||||
if (fontData[i].value == fontDataLegpElm.value) {
|
||||
fontObject.legp_searchActive(fontData[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
fontDataLegpElm.addEventListener('input', () => {
|
||||
for (let i = 0; i < fontData.length; i++) {
|
||||
if (fontData[i].value === fontDataLegpElm.value) {
|
||||
this.labelFontFamily = fontData[i].key
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
this._elms.labelFontFamily = [fontDataLegpElm]
|
||||
}
|
||||
}, 0)
|
||||
} else {
|
||||
if (this._DialogObject && this._DialogObject.close) {
|
||||
@ -2348,6 +2397,7 @@ class PolylineObject extends Base {
|
||||
this.labelShow = this.originalOptions.label.show
|
||||
this.labelColor = this.originalOptions.label.color
|
||||
this.labelFontSize = this.originalOptions.label.fontSize
|
||||
this.labelFontFamily = this.originalOptions.label.fontFamily
|
||||
this.labelLineWidth = this.originalOptions.label.lineWidth
|
||||
this.labelPixelOffset = this.originalOptions.label.pixelOffset
|
||||
this.labelLineColor = this.originalOptions.label.lineColor
|
||||
|
Reference in New Issue
Block a user