Browse Source

Merge branch 'dev_shequzhili' into test

test
ZhaoTongYao 4 years ago
parent
commit
d5980c9871
  1. 11
      src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue
  2. 30
      src/views/modules/visual/components/screen-map/index.vue

11
src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue

@ -447,11 +447,11 @@ export default {
//
loadMap () {
if (this.isfirstInit) {
this.agencyInfo.level = 'agency'
// this.agencyInfo.level = 'agency'
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
this.$refs.map.loadMap(this.agencyInfo, this.polygonList, null, this.distributionsList, this.iconUrlArray, null)
} else {
this.$refs.map.refreshMap(this.polygonList, this.distributionsList)
this.$refs.map.refreshMap(this.agencyInfo, this.polygonList, this.distributionsList, false)
}
},
@ -613,6 +613,9 @@ export default {
if (!this.agencyInfo.level) {
this.agencyInfo.level = 'street'
}
if (!this.agencyInfo.agencyLevel) {
this.agencyInfo.agencyLevel = 'street'
}
} else {
this.$message.error(msg);
}
@ -705,7 +708,7 @@ export default {
color: #fff;
}
.card-left-title::after {
content: '';
content: "";
position: absolute;
top: 50%;
left: 20px;
@ -713,7 +716,7 @@ export default {
height: 12px;
box-sizing: border-box;
margin-top: -6px;
background: #2865FA;
background: #2865fa;
border-radius: 50%;
}
.card-wr-map {

30
src/views/modules/visual/components/screen-map/index.vue

@ -200,11 +200,14 @@ const vueGis = {
distanceMax: null,//
input_lat: null,
input_lon: null
input_lon: null,
isChangeCenter: true,//
}
},
async mounted () {
},
methods: {
showPosition () {
@ -243,7 +246,6 @@ const vueGis = {
this.loadPolygon()
}
if (this.showIconLayer) {
//icon
this.initIconLayer()
@ -259,15 +261,22 @@ const vueGis = {
},
//
async refreshMap (mapInfo, polygonArray, iconArrays) {
//:
async refreshMap (mapInfo, polygonArray, iconArrays, isChangeCenter) {
this.mapInfo = mapInfo
this.polygonArray = []
this.polygonArray = polygonArray
this.iconArrays = iconArrays
this.isChangeCenter = isChangeCenter
if (iconSource) {
iconSource.clear()
}
if (polygonSource) {
polygonSource.clear()
}
if (polIconSource) {
polIconSource.clear()
}
this.initPolIconLayer()
if (this.showPolygonLayer) {
@ -346,7 +355,6 @@ const vueGis = {
this.loadPolIcon(feature)
}
}
},
@ -506,12 +514,16 @@ const vueGis = {
},
//
setMapLocation () {
if (!this.isChangeCenter) {
return false
}
// debugger
if (!this.zoom) {
this.setZoom(this.mapInfo.agencyLevel)
}
this.centerPoint = []
//
if (this.center && this.center.length > 0) {
this.centerPoint = this.center
@ -520,6 +532,8 @@ const vueGis = {
} else if (polygonLayer.getSource().getFeatures()[0]) {//,
this.centerFlag = 'flag_polygon'
this.centerPoint.push(this.mapInfo.longitude)
this.centerPoint.push(this.mapInfo.latitude)
} else if (this.mapInfo.longitude && this.mapInfo.latitude) {
this.centerPoint.push(this.mapInfo.longitude)
@ -530,6 +544,7 @@ const vueGis = {
this.centerPoint = centerPointGlobal
this.centerFlag = 'point'
}
// debugger
if (this.centerFlag === 'flag_parent') {
let parentFeatures = parentLayer.getSource().getFeatures()[0]
@ -549,7 +564,6 @@ const vueGis = {
}
mapView.setZoom(this.zoom);
},
firstCentermap () {
if (this.mapInfo.longitude && this.mapInfo.latitude) {
@ -608,7 +622,7 @@ const vueGis = {
})
}),
new Style({
// text: createTextStyle(feature) // zty 2022.05.19
// text: createTextStyle(feature) // zhaotongyao 2022.05.19
})
];
styles['MultiPolygon'] = styles['Polygon'];

Loading…
Cancel
Save