Browse Source

地图优化

master
mk 2 years ago
parent
commit
7ffff53e6c
  1. 50
      src/views/screenCenter/screenCenter.vue

50
src/views/screenCenter/screenCenter.vue

@ -110,7 +110,8 @@
<div :class="['item', { 'item-active': active === 'xfdw' }]" @click="handleClickTabs('xfdw')">先锋队伍0
</div>
<div :class="['item', { 'item-active': active === 'hshhr' }]" @click="handleClickTabs('hshhr')" >红色合伙人0
<div :class="['item', { 'item-active': active === 'hshhr' }]" @click="handleClickTabs('hshhr')">
红色合伙人0
</div>
</div>
@ -381,8 +382,6 @@ export default {
}
if (dotLayer) {
scene.removeLayer(dotLayer);
} if (dotLayerBto) {
scene.removeLayer(dotLayerBto);
}
this.buttonIndex = value
if (value == 1) {
@ -411,7 +410,7 @@ export default {
fontWeight: '500',
stroke: "#000",
textOffset: this.buttonIndex === 3 ? [10, 60] : [-30, 60],
raisingHeight: 700,
raisingHeight: 300,
heightfixed: true,
textAnchor: "center-left",
});
@ -425,7 +424,7 @@ export default {
.size(100)
.style({
layerType: "fillImage",
raisingHeight: 700,
raisingHeight: 300,
heightfixed: true
});
scene.addLayer(dotLayer);
@ -617,6 +616,7 @@ export default {
features: data,
}
if (this.level) {
// this.selAgency
obj.features.forEach(f => {
f.type = 'Feature';
f.properties = {};
@ -657,6 +657,8 @@ export default {
delete f.count;
});
}
console.log(obj,'居民点位数据伪装转');
this.initDot(obj)
} else {
console.log(msg);
@ -664,10 +666,13 @@ export default {
},
getDangzhibuDot() {
console.log(this.selAgency);
if( this.selAgency[0].type != 'grid'){
return
}
const selAgency = JSON.parse(JSON.stringify(this.selAgency));
let obj = {
type: 'FeatureCollection',
features: this.selAgency,
features:selAgency,
}
obj.features.forEach(f => {
f.type = 'Feature';
@ -679,10 +684,11 @@ export default {
f.properties.count = `${f.subName}党支部`;
f.geometry.type = "Point";
f.geometry.coordinates = [...JSON.parse(f.subCenterMark)[0]];
delete f.agencyName;
delete f.agencyId;
delete f.count;
delete f.subAreaMarks;
delete f.subCenterMark;
delete f.agencyLevel;
delete f.subId;
delete f.subName;
});
this.initDot(obj)
},
@ -837,7 +843,6 @@ export default {
scene.addLayer(textLayer);
let _this = this
polygonLayer.on("click", (e) => {
console.log(e);
if (e.feature.properties.name.indexOf("党工委") != -1) {
_this.level = e.feature.properties.level
_this.agencyId = e.feature.properties.adcode
@ -866,7 +871,17 @@ export default {
if (dotLayerBto) {
scene.removeLayer(dotLayerBto);
}
this.getBoundary(e.feature.properties.adcode || e.feature.properties.subId)
if (_this.buttonIndex == 1) {
_this.getScreenUserStatistics()
} else if (_this.buttonIndex == 2) {
_this.getScreenHouseStatistics()
} else if (_this.buttonIndex == 3 && _this.level == 'community') {
setTimeout(()=> {
_this.getDangzhibuDot()
}, 500)
}
});
// posLayer.on("click", (e) => {
// console.log(e);
@ -1132,22 +1147,27 @@ export default {
white-space: nowrap;
width: 539px;
height: 49px;
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
width: 6px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 2px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%);
border-radius: 3px;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #428ba2;
border-radius: 3px;
}
.item {
display: inline-block;
color: #fff;
@ -1168,6 +1188,4 @@ export default {
font-weight: 400;
}
}
</style>
}</style>
Loading…
Cancel
Save