lixuliang
2024-04-18 b5c4921d0828500379502a916a2ccf2d9d4acc96
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
/**
 * 工具栏-视图
 */
export default {
    methods: {
        // 截图
        createScreenshot() {
            window.sgworld.Analysis.createScreenshot();
        },
        modelbbox(btn) {
            btn.checked = !btn.checked;
            var primitives = window.Viewer.scene.primitives;
            for (var i = 0; i < primitives.length; i++) {
                var primitive = primitives.get(i);
                if (typeof primitive.debugShowBoundingVolume != "undefined") {
                    primitive.debugShowBoundingVolume = btn.checked;
                }
            }
        },
        // 截图预览
        createScreenshotView() {
            window.sgworld.Analysis.ScreenshotCompared("截图预览");
        },
        // 正北
        north() {
            window.sgworld.Navigate.flyToPointsInterest({
                destination: window.Viewer.camera.position,
                orientation: {
                    heading: 0,
                    pitch: window.Viewer.camera.pitch,
                    roll: 0,
                },
            });
        },
        // 俯瞰
        overlook() {
            window.sgworld.Navigate.flyToPointsInterest({
                destination: window.Viewer.camera.position,
                orientation: {
                    heading: window.Viewer.camera.heading,
                    pitch: Cesium.Math.toRadians(-90),
                    roll: 0,
                },
            });
        },
        // 最大化
        maximum() {
            window.Viewer.fullscreenButton.viewModel.command();
        },
        // 状态栏
        statusBar(btn) {
            btn.checked = !btn.checked;
            this.changeMapToolsVisible('statusbar');
        },
        positionButton(btn){
            btn.checked = !btn.checked;
            this.changeMapToolsVisible('hidePositionBtn');
        },
        //导航控件
        navigationBar(btn) {
            btn.checked = !btn.checked;
            this.changeNavBarVisible();
        },
        //比例尺控件
        scaleBar(btn) {
            btn.checked = !btn.checked;
            this.changeScaleBarVisible();
        },
        timeLine(btn) {
            btn.checked = !btn.checked;
            Viewer.timeline.container.style.visibility = btn.checked ? "visible" : "hidden";
        },
        // 地形三角网
        wireframe(btn) {
            btn.checked = !btn.checked;
            window.sgworld.wireframe = btn.checked;
        },
        // 瓦片区块
        tileCoordinates(btn) {
            btn.checked = !btn.checked;
            window.sgworld.tileCoordinates = btn.checked;
        },
    },
};