From ff7803c7293caa7f8aee531f83542c9e4f74a7ac Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 11 Feb 2022 13:47:22 +0800
Subject: [PATCH] 我的标记的修改完善

---
 src/pcviews/tool/sign.vue |   65 ++++++++++++++++++++++++++++----
 1 files changed, 57 insertions(+), 8 deletions(-)

diff --git a/src/pcviews/tool/sign.vue b/src/pcviews/tool/sign.vue
index b361e48..1f46892 100644
--- a/src/pcviews/tool/sign.vue
+++ b/src/pcviews/tool/sign.vue
@@ -1,5 +1,5 @@
 <template>
-    <div>456</div>
+    <div></div>
 </template>
 
 <script>
@@ -7,21 +7,70 @@
 
 export default {
     data () {
-        return { DC: null }
+        return {
+            DC: null,
+            destroyedFlag: true
+        }
     },
     computed: {
         ...mapGetters(['viewer'])
     },
-    created () {
+    mounted () {
         var that = this
         that.DC = global.DC
-        that.viewer.tooltip.enable = true
-        that.viewer.on(that.DC.MouseEventType.MOUSE_MOVE, (e) => {
-            that.viewer.tooltip.showAt(e.windowPosition, '我是鼠标提示')
+
+        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: {},
-    destroyed () { }
+    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>
 

--
Gitblit v1.9.3