|
|
@ -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); |
|
|
|