shuishen
2022-02-11 ff7803c7293caa7f8aee531f83542c9e4f74a7ac
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
<template>
    <div></div>
</template>
 
<script>
import { mapGetters } from 'vuex'
 
export default {
    data () {
        return {
            DC: null,
            destroyedFlag: true
        }
    },
    computed: {
        ...mapGetters(['viewer'])
    },
    mounted () {
        var that = this
        that.DC = global.DC
 
        that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => that.moveMessage(e, '点击确认标注位置'))
 
        that.viewer.on(that.DC.MouseEventType.CLICK, (e) => {
            if (that.destroyedFlag == false) return
 
            that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => that.moveMessage(e, ''))
 
            var popup = new this.DC.DivForms(this.viewer, {
                domId: 'AddTagBox',
                position: [that.DC.Transform.transformWGS84ToCartesian(
                    new that.DC.Position(
                        Number(
                            e.wgs84SurfacePosition.lng
                        ),
                        Number(
                            e.wgs84SurfacePosition.lat
                        ),
                        Number(
                            e.wgs84SurfacePosition.alt
                        )
                    )
                )]
            })
 
            that.$store.commit('SET_ADDTAGPOSITION', e.wgs84SurfacePosition)
            that.$store.commit('SET_ADDTAGPOPUP', true)
 
            that.$store.dispatch('delVisitedViews', this.$route)
            that.$router.push('/pcLayout/default')
        })
 
        // that.viewer.on(that.DC.MouseEventType.CLICK, (e) => {
        //     alert(111)
        // })
 
        // off
    },
    methods: {
        moveMessage (e, b) {
            if (b == '') {
                this.viewer.tooltip.enable = false
            } else {
                this.viewer.tooltip.enable = true
                this.viewer.tooltip.showAt(e.windowPosition, b)
            }
        }
    },
    destroyed () {
        var that = this
        that.destroyedFlag = false
        that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => that.moveMessage(e, ''))
    }
}
</script>
 
<style>
</style>