diff --git a/src/views/sanqing/main-gis/index.js b/src/views/sanqing/main-gis/index.js index d890a3e..6658907 100644 --- a/src/views/sanqing/main-gis/index.js +++ b/src/views/sanqing/main-gis/index.js @@ -140,7 +140,7 @@ export default { }); this.queryParams.deptId = res.user.deptId;//loginDeptId //列表请求 - this.getAllList(res.user.deptId); + // this.getAllList(res.user.deptId); // 加载地图 this.initMap(res.user.deptId); @@ -254,12 +254,13 @@ export default { // 加载地图 initMap (deptId) { gis = new GisUtils('map2') - gis.addTianDiTuLayer() - gis.addAnnotationLayer() // // 获取资源列表 this.getResourceList(deptId); + gis.addTianDiTuLayer() + gis.addAnnotationLayer() let dept2 = this.addrOptions[0]; //console.log(this.addrOptions, 'this.addrOptions'); + console.log(dept2.deptLevel) if (dept2.deptLevel === '5') { // 登录身份为市级领导 this.userRole = 'cityLeader'; @@ -274,7 +275,7 @@ export default { this.currentDeptLevel = '4'; // 添加乡镇边界 this.addTownBorder(dept2.children.map(item => item.id)); - gis.getView().setZoom(11); + gis.getView().setZoom(13); } else if (dept2.deptLevel === '3') { // 登录身份为镇级领导 this.userRole = 'townLeader'; @@ -288,6 +289,9 @@ export default { if (dept2.children) { this.addDeptLayer(dept2.children); } + + // gis.getMapContainer().getView().setCenter(fromLonLat([dept2.lng, dept2.lat])); + gis.getMapContainer().on("click", (evt) => { let feature = gis.getMapContainer().forEachFeatureAtPixel( evt.pixel,