From f02338804546d654f224686449efbdc341c601e3 Mon Sep 17 00:00:00 2001 From: little4 <360013221@qq.com> Date: Thu, 17 Oct 2024 10:24:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/RoadAndEvents/utils/map.js | 27 ++++++++++--------- .../views/JiHeExpressway/pages/Home/index.vue | 5 ---- 2 files changed, 15 insertions(+), 17 deletions(-) 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 @@