浏览代码

接口对接

dev
庞东旭 1 天前
父节点
当前提交
e400d180c2
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. +8
    -4
      src/views/sanqing/main-gis/index.js

+ 8
- 4
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,


正在加载...
取消
保存