Browse Source

更新地图

develop
little4 1 month ago
parent
commit
58a99842d2
  1. 9
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  2. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

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

@ -166,7 +166,14 @@ export default {
isGisCompleted: { isGisCompleted: {
async handler(bool) { async handler(bool) {
if (!bool) return; if (!bool) return;
await Promise.allSettled((this.tabContentData || []).map(item => this.handleDeviceImmediate(item, true))) const list = await Promise.allSettled((this.tabContentData || []))
function sleep(time){
return new Promise((resolve) => setTimeout(resolve, time));
}
for(let item of list) {
this.handleDeviceImmediate(item, true)
await sleep(500)
}
// Object.keys(lngLatMap).forEach(key => { // Object.keys(lngLatMap).forEach(key => {
// addInGraphHandle(lngLatMap[key]); // addInGraphHandle(lngLatMap[key]);
// }); // });

8
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -135,8 +135,8 @@ export class MarkerCluster {
Vue.prototype.mapIns.removeLayerByName(id); Vue.prototype.mapIns.removeLayerByName(id);
} }
removeData(_id, data) { removeData(_id, _data) {
data.forEach((item, index) => { _data.forEach((item, index) => {
const findIndex = this.data.findIndex( const findIndex = this.data.findIndex(
(removeData) => removeData === item (removeData) => removeData === item
); );
@ -163,13 +163,17 @@ export class MarkerCluster {
} }
if (findIndex > -1) this.data.splice(findIndex, 1); if (findIndex > -1) this.data.splice(findIndex, 1);
}); });
console.log('remove',_id,_data)
Vue.prototype.mapIns.removeLayerByName(_id); Vue.prototype.mapIns.removeLayerByName(_id);
if(_data && Array.isArray(_data) && _data.length > 0){
const self = this; const self = this;
setTimeout(() => { setTimeout(() => {
self.refreshLayer(_id, _data); self.refreshLayer(_id, _data);
}, 500); }, 500);
} }
}
clear() { clear() {
this.data = []; this.data = [];
} }

Loading…
Cancel
Save