From e400d180c2aa62f1d87d58819dd23a6f5b9786bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=9E=E4=B8=9C=E6=97=AD?= <850374051@qq.com> Date: Fri, 11 Jul 2025 14:20:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sanqing/main-gis/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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,