Преглед изворни кода

优化地图右键重复点击

JX.LI пре 2 година
родитељ
комит
80a8679e89
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      src/components/supermap-2.5d.vue

+ 6 - 0
src/components/supermap-2.5d.vue

@@ -63,6 +63,7 @@
           mapData: null,
           mapName: null
         },
+        clickTime: new Date().getTime()
       }
     },
     watch: {},
@@ -479,6 +480,11 @@
         let that = this;
         that.handler.setInputAction(function(movement) {
           that.mapshow = false
+          if (new Date().getTime() - that.clickTime < 2000) {
+            return
+          } else {
+            that.clickTime = new Date().getTime()
+          }
           // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;
           that.pick = that.viewer.scene.pick(movement.position);
           if (that.pick && that.pick) {