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