Browse Source

更新地图策略

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

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

@ -103,13 +103,6 @@ export class MarkerCluster {
} }
refreshLayer(){ refreshLayer(){
const map2d = Vue.prototype.mapIns
// map2d.addPointByArr(
// {pointList:[]}, // 点位数据数组(按以下规范组装)
// 'jhlayers', // 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
// true // 当前新加图层是否启用聚合效果
// );
// map2d.removeLayerByName('jhlayers')
const aryPoints = []; const aryPoints = [];
this.data.forEach(e=>{ this.data.forEach(e=>{
if(e.lnglat){ if(e.lnglat){
@ -156,11 +149,12 @@ export class MarkerCluster {
} }
}) })
if(aryPoints.length > 0){ if(aryPoints.length > 0){
map2d.addPointByArr( this.$root.$emit('refresh-gismap',pointsObj_new);
pointsObj_new, // {pointList:aryPoints} 点位数据数组(按以下规范组装) // map2d.addPointByArr(
'customLayer111', // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg // pointsObj_new, // {pointList:aryPoints} 点位数据数组(按以下规范组装)
true // 当前新加图层是否启用聚合效果 // 'customLayer111', // jhlayers 当前添加的数据 唯一标识(删除该图层时也会用到)//./事件专题/交通事故.svg
); // true // 当前新加图层是否启用聚合效果
// );
// console.log(aryPoints,'点位数组') // console.log(aryPoints,'点位数组')
} }
// if(Vue.prototype.isMapStatck){ // if(Vue.prototype.isMapStatck){

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

@ -129,8 +129,25 @@ export default {
// Vue.prototype.map2d = this.$refs.gisMap2d; // Vue.prototype.map2d = this.$refs.gisMap2d;
Vue.prototype.mapIns = this.$refs.gisMap2d; Vue.prototype.mapIns = this.$refs.gisMap2d;
this.isGisCompleted = true; this.isGisCompleted = true;
this.$root.$on('refresh-gismap', this.refreshLayer);
}, },
methods: { methods: {
refreshLayer(layers){
console.log(layers,'更新图标')
this.$refs.gisMap2d.addPointByArr(
{pointList:[]}, //
'jhlayers', // //.//.svg
true //
);
this.$refs.gisMap2d.removeLayerByName('jhlayers');
this.$refs.gisMap2d.addPointByArr(
layers,
"jhlayers",
true
);
},
debug(){ debug(){
this.$refs.Thumbnail.debug() this.$refs.Thumbnail.debug()
}, },
@ -157,15 +174,15 @@ export default {
this.$refs.gisMap2d.addPointByArr( this.$refs.gisMap2d.addPointByArr(
// this.pointsObj, // this.pointsObj,
pointsObj_new, pointsObj_new,
"customLayer111", "jhlayers",
true true
); );
}, },
ccccc() { ccccc() {
this.$refs.gisMap2d.removeLayerByName("customLayer111"); this.$refs.gisMap2d.removeLayerByName("jhlayers");
}, },
ddddd() { ddddd() {
this.$refs.gisMap2d.pileIsShow("customLayer111", this.isShow); this.$refs.gisMap2d.pileIsShow("jhlayers", this.isShow);
// this.$refs.gisMap2d.pileIsShow("customLayer222", this.isShow); // this.$refs.gisMap2d.pileIsShow("customLayer222", this.isShow);
this.isShow = !this.isShow; this.isShow = !this.isShow;
}, },

Loading…
Cancel
Save