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: {
async handler(bool) {
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 => {
// 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);
}
removeData(_id, data) {
data.forEach((item, index) => {
removeData(_id, _data) {
_data.forEach((item, index) => {
const findIndex = this.data.findIndex(
(removeData) => removeData === item
);
@ -163,13 +163,17 @@ export class MarkerCluster {
}
if (findIndex > -1) this.data.splice(findIndex, 1);
});
console.log('remove',_id,_data)
Vue.prototype.mapIns.removeLayerByName(_id);
if(_data && Array.isArray(_data) && _data.length > 0){
const self = this;
setTimeout(() => {
self.refreshLayer(_id, _data);
}, 500);
}
}
clear() {
this.data = [];
}

Loading…
Cancel
Save