From 997b962851777a6ab73808f9edb17cf1c44153a5 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 6 May 2020 17:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=A6=81=E7=94=A8=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 8 +++++--- src/views/designPlatform/bigScreen.vue | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index ce9987f9c..20bbf544a 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -502,8 +502,7 @@ class Jlmap { } off(eventname, cb) { - console.log(eventname, 111111); - const idx = Object.values(this.events).indexOf(eventname); + const idx = Object.values(this.events).indexOf(eventname); if (idx >= 0) { switch (eventname) { case this.events.Selected: @@ -519,7 +518,10 @@ class Jlmap { this.$keyboardController.off(this.events.keyboard, cb); break; case this.events.__Pan: - this.$keyboardController.off(this.events.__Pan, cb); + this.$mouseController.off(this.events.__Pan, cb); + break; + case this.events.__Zoom: + this.$mouseController.off(this.events.__Zoom, cb); break; } } diff --git a/src/views/designPlatform/bigScreen.vue b/src/views/designPlatform/bigScreen.vue index c7a708d99..5623bc2d1 100644 --- a/src/views/designPlatform/bigScreen.vue +++ b/src/views/designPlatform/bigScreen.vue @@ -8,7 +8,6 @@ import JlmapVisual from '@/views/newMap/jlmapNew/index'; import { loadMapDataById } from '@/utils/loaddata'; import { EventBus } from '@/scripts/event-bus'; import { mapGetters } from 'vuex'; -import Vue from 'vue'; export default { name: 'MapPreview', @@ -55,7 +54,7 @@ export default { '$store.state.map.mapViewLoadedCount':function() { this.$store.dispatch('map/setTrainWindowShow', false); console.log(this, this.$jlmap); - this.$jlmap.off('dataZoom'); + this.$jlmap.off('zoom'); this.$jlmap.off('pan'); } },