Browse Source

更新update

develop
little4 1 month ago
parent
commit
23bfe53072
  1. 3
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/BMapContainer/index.vue
  2. 1
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  3. 18
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

3
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/BMapContainer/index.vue

@ -41,7 +41,8 @@ export default {
// );
// Vue.prototype.map2d = this.$refs.gisMap2d;
Vue.prototype.mapIns = this.$refs.gisMap2d;
Vue.prototype.mapInsOpenLayers = []
Vue.prototype.mapIsLoading = false; //
Vue.prototype.mapLoadingData = []; //
this.$emit("update:isGisCompleted", true);
},
methods: {

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

@ -201,7 +201,6 @@ export default {
if(this.mapContainer === 'AMapContainer'){
getMinMapLayers();
}
markerClusterIns.vroot = this.$root;
markerClusterIns.mapContainer = this.mapContainer;
this.$root.$on('delete-event', this.handleRefresh);

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

@ -98,18 +98,23 @@ export class MarkerCluster {
}
async refreshLayer(){
if(Vue.prototype.mapIsLoading === true){
return;
}
Vue.prototype.mapIsLoading = true;
const map2d = Vue.prototype.mapIns
// map2d.addPointByArr(
// {pointList:[]}, // 点位数据数组(按以下规范组装)
// 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
// true // 当前新加图层是否启用聚合效果
// );
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
try{
console.log('执行remove')
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
if(Vue.prototype.mapLoadingData.length > 0){
map2d.removeLayerByName('jhlayers')
await sleep(2000)
} catch(e){}
Vue.prototype.mapLoadingData = []
}
await sleep(1000)
console.log('执行remove完毕')
const aryPoints = [];
this.data.forEach(e=>{
@ -157,15 +162,16 @@ export class MarkerCluster {
}
})
if(aryPoints.length > 0){
console.log('执行show')
Vue.prototype.mapLoadingData = aryPoints;
map2d.addPointByArr(
{pointList:aryPoints}, // 点位数据数组(按以下规范组装)
'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
true // 当前新加图层是否启用聚合效果
);
await sleep(2000)
await sleep(1000)
console.log('执行show完毕',aryPoints,'点位数组')
Vue.prototype.mapIsLoading = false
}
if(Vue.prototype.isMapStatck){
Vue.prototype.mapIns.pileIsShow("jhlayers", true);

Loading…
Cancel
Save