Browse Source

更新测试地图

develop
little4 1 month ago
parent
commit
f023388045
  1. 27
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  2. 5
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue

27
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 normalTitleBg = require(`@screen/images/mapBg/active_title.svg`);
const eventRegex = "./事件专题"; const eventRegex = "./事件专题";
import pointsObj_new from '../../../assets/data'
/** /**
* 聚合点 * 聚合点
*/ */
@ -101,12 +104,12 @@ export class MarkerCluster {
refreshLayer(){ refreshLayer(){
const map2d = Vue.prototype.mapIns const map2d = Vue.prototype.mapIns
map2d.addPointByArr( // map2d.addPointByArr(
{pointList:[]}, // 点位数据数组(按以下规范组装) // {pointList:[]}, // 点位数据数组(按以下规范组装)
'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg // 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
true // 当前新加图层是否启用聚合效果 // true // 当前新加图层是否启用聚合效果
); // );
map2d.removeLayerByName('jhlayers') // map2d.removeLayerByName('jhlayers')
const aryPoints = []; const aryPoints = [];
this.data.forEach(e=>{ this.data.forEach(e=>{
if(e.lnglat){ if(e.lnglat){
@ -154,15 +157,15 @@ export class MarkerCluster {
}) })
if(aryPoints.length > 0){ if(aryPoints.length > 0){
map2d.addPointByArr( map2d.addPointByArr(
{pointList:aryPoints}, // 点位数据数组(按以下规范组装) pointsObj_new, // {pointList:aryPoints} 点位数据数组(按以下规范组装)
'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg 'customLayer111', // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
true // 当前新加图层是否启用聚合效果 true // 当前新加图层是否启用聚合效果
); );
console.log(aryPoints,'点位数组') // console.log(aryPoints,'点位数组')
}
if(Vue.prototype.isMapStatck){
Vue.prototype.mapIns.pileIsShow("jhlayers", true);
} }
// if(Vue.prototype.isMapStatck){
// Vue.prototype.mapIns.pileIsShow("jhlayers", true);
// }
} }
async showInfoWindow(data) { async showInfoWindow(data) {
const AMap = await loadAMap(); const AMap = await loadAMap();

5
ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue

@ -1,14 +1,9 @@
<template> <template>
<div style="width: 100%;height: 100%;"> <div style="width: 100%;height: 100%;">
<div class="btnBox"> <div class="btnBox">
<div class="btnItem" @click="aaaaa">外层点击交互联动</div>
<div class="btnItem" @click="bbbbb">添加点位</div> <div class="btnItem" @click="bbbbb">添加点位</div>
<div class="btnItem" @click="ccccc">删除图层</div> <div class="btnItem" @click="ccccc">删除图层</div>
<div class="btnItem" @click="ddddd">操作桩号</div> <div class="btnItem" @click="ddddd">操作桩号</div>
<div class="btnItem" @click="eeeee">打开雷达云图</div>
<div class="btnItem" @click="fffff">关闭雷达云图</div>
<div class="btnItem" @click="ggggg">图层显示</div>
<div class="btnItem" @click="hhhhh">图层隐藏</div>
</div> </div>
<!-- <component :is="mapContainer" ref="MapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" /> --> <!-- <component :is="mapContainer" ref="MapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" /> -->
<div class="BMapContainer"> <div class="BMapContainer">

Loading…
Cancel
Save