ソースを参照

优化地图右键重复点击

JX.LI 2 年 前
コミット
9823679400
1 ファイル変更7 行追加1 行削除
  1. 7 1
      src/components/supermap-2.5d.vue

+ 7 - 1
src/components/supermap-2.5d.vue

@@ -65,7 +65,8 @@
           mapData: null,
           mapName: null
         },
-        showLayer:null
+        showLayer:null,
+        clickTime: new Date().getTime()
       }
     },
     watch: {},
@@ -472,6 +473,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()
+          }
           clearInterval(that.timer)
           // 监听鼠标的当前位置坐标,然后根据当前坐标去动态更新气泡窗口div的显示位置;
           that.pick = that.viewer.scene.pick(movement.position);