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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/**
 * 工具栏-场景
 */
var Cesium = window.Cesium;
// 全球网格
var LayerGrid = null;
// 鹰眼
var HawkeyeData = null;
// 夜晚模式
var isNightMode = false;
import Bus from "@tools/Bus";
export default {
    data() {
        return {
            // 雾
            isFog: false,
            // 雨
            isRain: false,
            // 雪
            isSnow: false,
            // 天际线
            isSkyLine: false,
        };
    },
    methods: {
        // 场景 - 天空纹理
        skyTexture() {
            this.$refs.skyTexture.open();
        },
        // 场景 - 雨
        rain(btn) {
            btn.checked = !btn.checked;
            this.isRain = !this.isRain;
            if (this.isRain) {
                sgworld.Analysis.createWeather("rain", true);
            } else {
                sgworld.Analysis.createWeather("rain", false);
            }
        },
        // 场景 - 雪
        snow(btn) {
            btn.checked = !btn.checked;
            this.isSnow = !this.isSnow;
            if (this.isSnow) {
                sgworld.Analysis.createWeather("snow", true);
            } else {
                sgworld.Analysis.createWeather("snow", false);
            }
        },
        // 场景 - 雾
        fog(btn) {
            btn.checked = !btn.checked;
            this.isFog = !this.isFog;
            if (this.isFog) {
                sgworld.Analysis.createWeather("fog", true, {
                    distance: 1000,
                    color: "rgba(255,255,255,0.9)",
                });
            } else {
                sgworld.Analysis.createWeather("fog", false);
            }
        },
        // 场景 - 室内模式
        indoorModel(btn) {
            sgworld.Analysis.createindoormode({
                showHelp: true,
                helpPosition: {
                    top: '20px',
                    right: '20px'
                }
            });
        },
        // 场景 - 地下模式
        undergroundModel() {
            this.$refs.undergroundModel.open();
        },
        // 场景 - 全球网格
        globalGrid(btn) {
            btn.checked = !btn.checked;
            if (!LayerGrid) {
                LayerGrid = sgworld.Creator.createImageryLayerGrid();
            } else {
                LayerGrid.item.show = !LayerGrid.item.show;
            }
        },
        // 场景 - 鹰眼
        HawkEye(btn) {
            btn.checked = !btn.checked;
            if (!HawkeyeData) {
                HawkeyeData = sgworld.Creator.createHawkeye(
                    {
                        imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
                            url: "http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk=c53eb074c3fcba5ac86103d4d711bbe8",
                            layer: "tdtBasicLayer",
                            style: "default",
                            format: "image/jpeg",
                            tileMatrixSetID: "GoogleMapsCompatible",
                            show: false,
                        }),
                    },
                    { left: "0px" }
                );
            } else {
                HawkeyeData.close();
                HawkeyeData = undefined;
            }
        },
        // 场景 - 夜晚
        nightModel(btn) {
            btn.checked = !btn.checked;
            isNightMode = !isNightMode;
            sgworld.Creator.NightMode(isNightMode);
            if (isNightMode) {
                this.$notify({
                    title: "夜晚模式",
                    message: "夜晚模式已开启",
                    type: "success",
                    duration: "2000",
                });
            } else {
                this.$notify({
                    title: "夜晚模式",
                    message: "地下模式已关闭",
                    duration: "2000",
                });
            }
        },
        // 场景 - HDR
        HDRmodel(btn) {
            btn.checked = !btn.checked;
            if (Viewer.scene.highDynamicRange == false) {
                Viewer.scene.highDynamicRange = true;
                this.$notify({
                    title: "HDR",
                    message: "已开启HDR",
                    type: "success",
                    duration: "2000",
                });
            } else {
                Viewer.scene.highDynamicRange = false;
                this.$notify({
                    title: "HDR",
                    message: "已关闭HDR",
                    duration: "2000",
                });
            }
        },
        Localtion() {
            // 打开路径查询弹窗
            this.$refs.localtion && this.$refs.localtion.open();
        },
        // 演示动画
        DemoAnimation() {
            this.$refs.DemoAnimation.open();
        },
        // 演示动画
        DemoAnimationtest() {
            Bus.$emit("editDemoAnimation");
        },
        // 征拆迁演示
        Demolition() {
            this.$refs.Demolition.open();
        },
        colorAdjustment(){
            this.$refs.colorAdjustment.open();
        }
    },
};