diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 7090320df..4e45c828c 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -185,7 +185,7 @@ const map = { namespaced: true, state: { - map: {}, // 地图数据 + map: null, // 地图数据 mapList: {}, // 地图数据列表 mapViewLoadedCount: 0, // 地图视图加载完成标识 mapDataLoadedCount: 0, // 地图数据加载完成标识 @@ -445,7 +445,7 @@ const map = { } }, mapClear: (state) => { - state.map = {}; + state.map = null; Vue.prototype.$jlmap && Vue.prototype.$jlmap.clear(); } }, diff --git a/src/views/jlmap/index.vue b/src/views/jlmap/index.vue index 239b62db4..5d1125312 100644 --- a/src/views/jlmap/index.vue +++ b/src/views/jlmap/index.vue @@ -71,7 +71,11 @@ export default { watch: { '$store.state.map.map': function (val, old) { try { - this.setMap(val); + if (val) { + this.setMap(val); + } else { + this.mapViewLoaded(false); + } } catch (error) { console.log('[ERROR] ', error); this.mapViewLoaded(false); diff --git a/src/views/map/mapdraft/mapedit/index.vue b/src/views/map/mapdraft/mapedit/index.vue index 62d548081..640307a91 100644 --- a/src/views/map/mapdraft/mapedit/index.vue +++ b/src/views/map/mapdraft/mapedit/index.vue @@ -148,6 +148,10 @@ export default { if (!isSuccess) { this.$store.dispatch('map/mapClear'); } + + this.$nextTick(() => { + eventBus.$emit('viewLoading', false); + }) }, loadInitPage() { this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT });