diff --git a/src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue b/src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue
index 4b64c27f0..54da7f0ff 100644
--- a/src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue
+++ b/src/views/modules/visual/communityGovern/duoyuanfuwu/duoyuanfuwufenxi.vue
@@ -36,11 +36,11 @@
@@ -82,8 +82,8 @@
+ :orgId="orgId"
+ @close="showInfoDialog = false" />
@@ -103,8 +103,8 @@ import { pieOption } from './pieOption.js'
import nextTick from 'dai-js/tools/nextTick'
const transparent = 'rgba(2, 2, 2, 0)'
-const polygonColorArray = [ '#f59701', '#0067b6', '#e70014', '#8fc41e', '#00a1be' ]
-const colorArray = [ '#1B51FF', '#00E5ED', '#7800FF', '#16D783', '#FF7800', '#FFBA00', '#FFD685', '#2A00FF', '#C600FF', '#FF2A00']
+const polygonColorArray = ['#f59701', '#0067b6', '#e70014', '#8fc41e', '#00a1be']
+const colorArray = ['#1B51FF', '#00E5ED', '#7800FF', '#16D783', '#FF7800', '#FFBA00', '#FFD685', '#2A00FF', '#C600FF', '#FF2A00']
const legendList = [
{ name: '#e70014', icon: require('../../../../../assets/img/shuju/volunteer4.png') },
{ name: '#f59701', icon: require('../../../../../assets/img/shuju/volunteer5.png') },
@@ -349,7 +349,7 @@ export default {
return item.name == name
})
},
- async loadOrgData (level='', orgId='') {
+ async loadOrgData (level = '', orgId = '') {
const url = "/gov/org/agency/maporg"
let params = {
orgId: orgId,
@@ -363,7 +363,7 @@ export default {
if (!this.isRepeatItem(item.name)) {
let colorIndex = index < polygonColorArray.length ? index : 0
item.fillColor = transparent,
- item.color = polygonColorArray[colorIndex]
+ item.color = polygonColorArray[colorIndex]
subPolygonList.push(item)
}
}
@@ -375,7 +375,7 @@ export default {
// color: polygonColorArray[1]
// }
// polygonList.push(polygonData)
- this.polygonList = [ ...this.polygonList, ...subPolygonList ]
+ this.polygonList = [...this.polygonList, ...subPolygonList]
} else {
this.$message.error(msg)
}
@@ -451,7 +451,7 @@ export default {
//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.agencyInfo, this.polygonList, this.distributionsList)
+ this.$refs.map.refreshMap(this.agencyInfo, this.polygonList, this.distributionsList, false)
}
},
@@ -478,7 +478,7 @@ export default {
data.organizationPersonnel.forEach(item => {
organizationPersonnel = `${organizationPersonnel}${item.personName}(${item.personPhone})、`
})
- organizationPersonnel = organizationPersonnel.substring(0, organizationPersonnel.length-1)
+ organizationPersonnel = organizationPersonnel.substring(0, organizationPersonnel.length - 1)
} else {
organizationPersonnel = '--'
}
@@ -540,18 +540,18 @@ export default {
// data.isBdhjShow = data.isBdhj ? data.isBdhj === '0' ? '否' : '是' : '--'
// data.genderShow = data.gender ? data.gender === '0' ? '女' : '男' : '--'
- // let categoriesArray = []
+ // let categoriesArray = []
- // for (let key in data.volunteerCategories) {
- // categoriesArray.push(data.volunteerCategories[key])
+ // for (let key in data.volunteerCategories) {
+ // categoriesArray.push(data.volunteerCategories[key])
- // }
+ // }
- // if (categoriesArray.length > 0) {
- // data.categories = categoriesArray.join(',')
- // } else {
- // data.categories = '--'
- // }
+ // if (categoriesArray.length > 0) {
+ // data.categories = categoriesArray.join(',')
+ // } else {
+ // data.categories = '--'
+ // }
// let showData = `
// 居民信息
@@ -708,7 +708,7 @@ export default {
color: #fff;
}
.card-left-title::after {
- content: '';
+ content: "";
position: absolute;
top: 50%;
left: 20px;
@@ -716,7 +716,7 @@ export default {
height: 12px;
box-sizing: border-box;
margin-top: -6px;
- background: #2865FA;
+ background: #2865fa;
border-radius: 50%;
}
.card-wr-map {
diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue
index a8d87ca4a..0d9f75ce1 100644
--- a/src/views/modules/visual/components/screen-map/index.vue
+++ b/src/views/modules/visual/components/screen-map/index.vue
@@ -32,7 +32,7 @@
class="ol-popup-closer">
-
@@ -107,9 +107,9 @@ let polygonColorArray = [
'rgba(183, 185, 0, 0.16)'
];
- //icon文字样式
+//icon文字样式
let createTextStyle = function (feature) {
-
+
if (iconTextsStyle) {
let iconTextsStyles = { ...iconTextsStyle }
iconTextsStyles.text = feature.values_ && feature.values_.name || feature.name
@@ -200,7 +200,9 @@ const vueGis = {
distanceMax: null,//显示的坐标距离中心点的范围
input_lat: null,
- input_lon: null
+ input_lon: null,
+
+ isChangeCenter: true,//是否根据多边形改变数组
}
},
async mounted () {
@@ -225,11 +227,11 @@ const vueGis = {
// iconArrays.forEach(item => {
// console.log(item.type, item.urlIndex, item.latitude, item.longitude)
// });
-
+
//初始化地图
this.initMap()
-
+
if (this.showPolIconLayer) {
console.log('showPolIconLayer++++++++++++++++++++++', this.showPolIconLayer)
//初始化多边形标注图层
@@ -259,12 +261,13 @@ const vueGis = {
},
- //刷新地图
- async refreshMap (mapInfo, polygonArray, iconArrays) {
+ //刷新地图:地图信息,多边形数组,标注数组,是否根据多边形改变中心点
+ async refreshMap (mapInfo, polygonArray, iconArrays, isChangeCenter) {
this.mapInfo = mapInfo
- this.polygonArray = []
+ this.polygonArray = []
this.polygonArray = polygonArray
this.iconArrays = iconArrays
+ this.isChangeCenter = isChangeCenter
if (iconSource) {
iconSource.clear()
}
@@ -275,7 +278,7 @@ const vueGis = {
polIconSource.clear()
}
this.initPolIconLayer()
-
+
if (this.showPolygonLayer) {
this.initPolygonLayer()
//加载当前园区的标注
@@ -293,7 +296,7 @@ const vueGis = {
}
this.setMapLocation()
// gaodeMapLayer.getSource().changed()
-
+
},
//加载区域多边形
@@ -511,6 +514,11 @@ const vueGis = {
},
//设置地图定位的中心点和缩放级别
setMapLocation () {
+
+ if (!this.isChangeCenter) {
+ return false
+ }
+ // debugger
if (!this.zoom) {
this.setZoom(this.mapInfo.agencyLevel)
}
@@ -557,7 +565,7 @@ const vueGis = {
mapView.setZoom(this.zoom);
},
- firstCentermap() {
+ firstCentermap () {
if (this.mapInfo.longitude && this.mapInfo.latitude) {
this.centerPoint = []
this.centerPoint.push(this.mapInfo.longitude)
@@ -749,14 +757,14 @@ const vueGis = {
this.overlay.getElement().parentNode.parentNode.style.display = 'block'
content.innerHTML = showData;
this.overlay.setPosition(coordinate);
- //把 overlay 显示到指定的 x,y坐标
-
+ //把 overlay 显示到指定的 x,y坐标
+
},
// 关闭弹窗
- handleClosePopup() {
- this.overlay.setPosition(undefined);
- document.getElementById("popup-closer").blur();
- return false;
+ handleClosePopup () {
+ this.overlay.setPosition(undefined);
+ document.getElementById("popup-closer").blur();
+ return false;
},
//取随机数
@@ -901,7 +909,7 @@ export default vueGis;
.popup-content {
width: 300px;
}
-.popup-goMore{
+.popup-goMore {
margin: 20px 0;
}
.ol-popup-closer:after {