+
0) {
this.subAgencyArray = data.children
- this.selAgencyId = this.subAgencyArray[0].id
+ // this.selAgencyId = this.subAgencyArray[0].id
} else {
this.subAgencyArray = []
- this.selAgencyId = ''
+ // this.selAgencyId = ''
}
}
@@ -300,9 +301,7 @@ const vueGis = {
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
-
});
-
}
if (featureData && featureData.length > 0) {
@@ -320,23 +319,26 @@ const vueGis = {
//选择feature
selectFeature (e) {
- if (this.method === undefined || this.method === '') {
- this.selAgencyId = e.selected[0].id_
- this.subAgencyArray.forEach((element, index) => {
- if (element.id === e.selected[0].id_) {
- this.selAgencyIndex = index
- this.orgChange(index)
- }
+ if (e.selected.length > 0) {
+ console.log("selectFeature22222222222222222222222")
+ if (this.method === undefined || this.method === '') {
+ this.selAgencyId = e.selected[0].id_
+ this.subAgencyArray.forEach((element, index) => {
+ if (element.id === e.selected[0].id_) {
+ this.selAgencyIndex = index
+ this.orgChange(index)
+ }
- });
+ });
+ }
}
-
},
//下钻到下一级
toSubAgency (e) {
if (this.method != 'mAddPolygon' && this.level != 'neighborHood') {
+ this.selAgencyId = ''
//下钻到下一级
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
@@ -359,10 +361,12 @@ const vueGis = {
//高亮某个标注
highlightPolygon () {
+
let features = polygonSource.getFeatures()
features.forEach(element => {
if (element.id_ === this.selAgencyId) {
+
selectedFeatures.push(element)
}
});
@@ -383,11 +387,11 @@ const vueGis = {
//根据组织层级设置缩放级别
setZoom (agencyLevel) {
if (agencyLevel === 'district') {
- this.zoom = 14
+ this.zoom = 13
} else if (agencyLevel === 'street') {
- this.zoom = 15
+ this.zoom = 14
} else if (agencyLevel === 'community') {
- this.zoom = 16
+ this.zoom = 15
}
},