diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js index 6d28e1b8..4d0a9c7b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js @@ -33,6 +33,9 @@ const faultTitleBg = require(`@screen/images/mapBg/fault_title.svg`); const normalTitleBg = require(`@screen/images/mapBg/active_title.svg`); const eventRegex = "./事件专题"; + + +import pointsObj_new from '../../../assets/data' /** * 聚合点 */ @@ -101,12 +104,12 @@ export class MarkerCluster { refreshLayer(){ const map2d = Vue.prototype.mapIns - map2d.addPointByArr( - {pointList:[]}, // 点位数据数组(按以下规范组装) - 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg - true // 当前新加图层是否启用聚合效果 - ); - map2d.removeLayerByName('jhlayers') + // map2d.addPointByArr( + // {pointList:[]}, // 点位数据数组(按以下规范组装) + // 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg + // true // 当前新加图层是否启用聚合效果 + // ); + // map2d.removeLayerByName('jhlayers') const aryPoints = []; this.data.forEach(e=>{ if(e.lnglat){ @@ -154,15 +157,15 @@ export class MarkerCluster { }) if(aryPoints.length > 0){ map2d.addPointByArr( - {pointList:aryPoints}, // 点位数据数组(按以下规范组装) - 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg + pointsObj_new, // {pointList:aryPoints} 点位数据数组(按以下规范组装) + 'customLayer111', // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg true // 当前新加图层是否启用聚合效果 ); - console.log(aryPoints,'点位数组') - } - if(Vue.prototype.isMapStatck){ - Vue.prototype.mapIns.pileIsShow("jhlayers", true); + // console.log(aryPoints,'点位数组') } + // if(Vue.prototype.isMapStatck){ + // Vue.prototype.mapIns.pileIsShow("jhlayers", true); + // } } async showInfoWindow(data) { const AMap = await loadAMap(); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue index bd042a2b..8e6e23bc 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue @@ -1,14 +1,9 @@