export default {
|
methods: {
|
// 编辑
|
editWfs(editType, wfsData, editData) {
|
let type = this.data.class;
|
let value = Cesium.defaultValue(this.data[this.data.class][editType], this.data[editType])
|
if (value === undefined && this.polygonLabel) {
|
value = this.data.point[editType]
|
}
|
let data = {}
|
if (editType === 'pointType') {
|
if (this.pointType === 'label') {
|
data = {
|
text: this.data.text,
|
image: ''
|
}
|
} else if (this.pointType === 'billboard') {
|
data = {
|
image: this.data.image,
|
text: ''
|
}
|
} else {
|
data = {
|
text: this.data.text,
|
image: this.data.image
|
}
|
}
|
} else if (editType === 'color') {
|
let color = window.Cesium.Color.fromCssColorString(this.data.color);
|
let alpha = color.alpha;
|
color.alpha = 1;
|
data = {
|
color: color.toCssHexString(),
|
alpha: alpha
|
};
|
} else if (editType === 'showBackground') {
|
editData.bgColor = this.showBackground ? '#ff0000' : ''
|
} else if (editType === 'IgnoreShelter') {
|
this.IgnoreShelter ? (data.disableDepthTestDistance = "Infinity") : (data.disableDepthTestDistance = 0);
|
} else if (editType === 'fontStyle') {
|
this.fontStyle.includes("bold") ? data.bold = true : data.bold = false;
|
this.fontStyle.includes("italic") ? data.italic = true : data.italic = false;
|
} else if (editType === 'polygonLabel') {
|
data.text = this.polygonLabel ? this.data.text : ''
|
} else {
|
data[editType] = value
|
}
|
Object.assign(editData, data)
|
wfsData.destroy()
|
wfsData = sgworld._treeTool.sgwfs.CreateWfs(type, editData)
|
return wfsData
|
},
|
// 还原
|
restore(wfsData) {
|
wfsData.destroy()
|
wfsData = sgworld._treeTool.sgwfs.CreateWfs(this.defaultEditData.class, this.defaultEditData)
|
sgworld._treeTool.treeData.set(this.defaultEditData.id, wfsData)
|
}
|
}
|
}
|