Browse Source

更新地图刷新

wangqin
王钦 11 months ago
parent
commit
3a20c18ad6
  1. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

21
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -189,12 +189,17 @@ export default {
}
getMinMapLayers();
this.$root.$on('delete-event', this.handleRefresh);
},
beforeDestroy() {
this.emitter.off("selectedCompleted", this.selectedCompletedHandle);
Object.keys(lngLatMap).forEach(key => delete lngLatMap[key]);
markerClusterIns.clear();
window.renderData = undefined;
this.$root.$off('delete-event', this.handleRefresh);
},
methods: {
selectedCompletedHandle(item) {
@ -262,19 +267,21 @@ export default {
handleDevice: debounce(async function (item) {
await this.handleDeviceImmediate(item);
}, 360),
handleRefresh(){
//
const { mapIns } = this.getMap();
console.log(mapIns.getLayers(),'-----')
mapIns.getLayers().forEach((layer, index) => index > this.minLayers && mapIns.remove(layer))
async handleRefresh(){
const tab = _.filter(this.tabContentData,{status:'_active'})
try{
this.handleCleared();
} catch(e){
}
tab.forEach(async item=>{
await this.handleDeviceImmediate(item);
})
},
handleCleared() {
const { mapIns } = this.getMap();
this.layerData.forEach(({ children }) => {
children.forEach(item => item.status = "")
});
if (!mapIns) return;
for (const key in cacheRemoveFunc) {

Loading…
Cancel
Save