lixuliang
2024-04-19 1fef6dcc04ffe09336e4983c2b05962ad901e545
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export default {
    methods: {
        // 编辑模型
        editVector(editType, vector) {
            let type = this.data.class;
            let value = Cesium.defaultValue(this.data[this.data.class][editType], this.data[editType])
            if (type === 'point') {
                editType === 'color' && (editType = 'fillColor')
                editType === 'pointHeight' && (editType = 'height')
                editType === 'size' && (editType = 'font_size')
            } else {
                editType === 'color' && (editType = 'material')
            }
            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 === '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 {
                data[editType] = value
            }
            vector.updataVector(data)
        },
        // 还原
        restore(vector) {
            vector.restoreVector && vector.restoreVector()
        }
    }
}