Browse Source

优化地图

wulanhaote
hbao 3 years ago
parent
commit
527dde6860
4 changed files with 140 additions and 77 deletions
  1. +1
    -1
      src/api/system/config.js
  2. +38
    -2
      src/components/Map/MapGisDrawing.vue
  3. +11
    -7
      src/views/homesteadSurvey/add.vue
  4. +90
    -67
      src/views/homesteadSurvey/list.vue

+ 1
- 1
src/api/system/config.js View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
//查询geoserver服务地址 //查询geoserver服务地址
export function getGeoServerConfigKey() { export function getGeoServerConfigKey() {
return request({ return request({
url: '/system/config/getGeoServerConfigKey',
url: '/system/config/configKey/'+"system.geoServer.url",
method: 'get' method: 'get'
}) })
} }

+ 38
- 2
src/components/Map/MapGisDrawing.vue View File

@@ -119,9 +119,16 @@ export default {
}), }),
}); });
that.mapData= that.message; that.mapData= that.message;
var zjdTc;
var zrzTc;
var fsssTc;
map.removeLayer(zrzTc);
map.removeLayer(zjdTc);
map.removeLayer(fsssTc);
//宅基地图层查询开始 ------------------start //宅基地图层查询开始 ------------------start
var cql_filter_all = "dept_id='" + that.$cookies.get("item").deptId + "'";
var zjdTc= new ol.layer.Tile({
var cql_filter_all = "dept_id='" + that.$cookies.get("item").deptId + "'" + "and zjddm='" + that.$cookies.get("item").zjddm + "'";
console.log(that.$cookies.get("item"));
zjdTc= new ol.layer.Tile({
source: new ol.source.TileWMS({ source: new ol.source.TileWMS({
url: that.mapGeoServerUrl +"/geoserver/zjd_dc/wms", url: that.mapGeoServerUrl +"/geoserver/zjd_dc/wms",
params: { params: {
@@ -134,6 +141,35 @@ export default {
}); });
map.addLayer(zjdTc); map.addLayer(zjdTc);
//宅基地图层查询开始 ------------------start //宅基地图层查询开始 ------------------start
//自然幢图层查询开始 ------------------start
zrzTc= new ol.layer.Tile({
source: new ol.source.TileWMS({
url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
params: {
LAYERS: 'zjd_dc:t_house_survey_zrz',
TILED: true,
cql_filter: cql_filter_all,
SRID: 3857,
},
}),
});
map.addLayer(zrzTc);
//自然幢图层查询结束 ------------------end

//附属设施图层查询开始 ------------------start
fsssTc= new ol.layer.Tile({
source: new ol.source.TileWMS({
url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
params: {
LAYERS: 'zjd_dc:t_house_survey_fsss',
TILED: true,
cql_filter: cql_filter_all,
SRID: 3857,
},
}),
});
map.addLayer(fsssTc);
//附属设施图层查询结束 ------------------end
//图层查询定位开始 ---------start //图层查询定位开始 ---------start
if(this.message.substring(0,1) =="{"){ if(this.message.substring(0,1) =="{"){
//that.newHt ="1"; //that.newHt ="1";


+ 11
- 7
src/views/homesteadSurvey/add.vue View File

@@ -3138,6 +3138,7 @@
activeBtn:"", activeBtn:"",
backMapZjdAData:"", backMapZjdAData:"",
deptId:"", deptId:"",
zjddm:"",
}, },
//记录是否从地图进入 //记录是否从地图进入
enterMap: "", enterMap: "",
@@ -3153,6 +3154,7 @@
}; };
}, },
created(){ created(){
console.log(this.$cookies.get("search"));
if(this.$cookies.get("search")){ if(this.$cookies.get("search")){
if(this.$cookies.get("search").active!=null){ if(this.$cookies.get("search").active!=null){
this.cookiesInfo = this.$cookies.get("search") this.cookiesInfo = this.$cookies.get("search")
@@ -3162,7 +3164,9 @@
this.enterMap =1; this.enterMap =1;
this.backMap.backMapZjdAData = this.cookiesInfo.mapZjdAData; this.backMap.backMapZjdAData = this.cookiesInfo.mapZjdAData;
this.backMap.deptId = this.cookiesInfo.mapZjdAData.deptId; this.backMap.deptId = this.cookiesInfo.mapZjdAData.deptId;
this.enterMapZjddm = this.cookiesInfo.mapZjdAData.zjddm;
this.backMap.zjddm = this.cookiesInfo.mapZjdAData.zjddm;
this.$cookies.set("item",this.backMap);
//this.enterMapZjddm = this.cookiesInfo.mapZjdAData.zjddm;
//返回地图值记录----end //返回地图值记录----end
this.active = this.cookiesInfo.active; this.active = this.cookiesInfo.active;
this.item = this.cookiesInfo.mapZjdAData; this.item = this.cookiesInfo.mapZjdAData;
@@ -4138,12 +4142,12 @@
this.showPickerxzkssj= false this.showPickerxzkssj= false
}, },
goBack(){ goBack(){
if(this.enterMap ==1){
this.$cookies.set("item",this.backMap);
this.$router.push({name:'homesteadList'});
} else {
this.$router.push({name:'homesteadList'});
}
// if(this.enterMap ==1){
// this.$cookies.set("item",this.backMap);
// this.$router.push({name:'homesteadList'});
// } else {
this.$router.push({name:'homesteadList'});
// }
}, },
// 设为户主 // 设为户主
setNh(item,index){ setNh(item,index){


+ 90
- 67
src/views/homesteadSurvey/list.vue View File

@@ -1322,15 +1322,15 @@
mapTheGeomZjdId: null, mapTheGeomZjdId: null,
mapTheGeomFsssId: null, mapTheGeomFsssId: null,
drawInsert:null, drawInsert:null,
mapZjdData:{},
mapZrzData:{},
mapFsssData:{},
mapZjdData:"",
mapZrzData:"",
mapFsssData:"",
mapZjdDataTure:"", mapZjdDataTure:"",
mapZjdTeAll:{ mapZjdTeAll:{
active:"", active:"",
mapZjdAData:{},
mapZrzAData:{},
mapFsssAData:{},
mapZjdAData:"",
mapZrzAData:"",
mapFsssAData:"",
}, },
mapHaDataValue:false, mapHaDataValue:false,
mapHasDateStatus: 0, //0附属设施 1自然幢 2宅基地 mapHasDateStatus: 0, //0附属设施 1自然幢 2宅基地
@@ -1346,6 +1346,7 @@
checked:['zjdSx', 'zrzSx', 'fsssSx'], checked:['zjdSx', 'zrzSx', 'fsssSx'],
checkAllMap: false, checkAllMap: false,
sx:"", sx:"",
drawingClick:true,
//搜索---start //搜索---start
seachText: "", seachText: "",
selectionIconShow: false, selectionIconShow: false,
@@ -1421,13 +1422,16 @@
this.getDicts("member_remark").then(response => { this.getDicts("member_remark").then(response => {
this.cybzOptions = response.data; this.cybzOptions = response.data;
}); });
console.log(this.$cookies.get("item"));
if(this.$cookies.get("item").activeBtn !=null){ if(this.$cookies.get("item").activeBtn !=null){
if(this.$cookies.get("item").activeBtn == 4){ if(this.$cookies.get("item").activeBtn == 4){
this.activeBtn = this.$cookies.get("item").activeBtn; this.activeBtn = this.$cookies.get("item").activeBtn;
this.item = this.$cookies.get("item").backMapZjdAData; this.item = this.$cookies.get("item").backMapZjdAData;
this.mapAddJump = this.$cookies.get("item").backMapZjdAData.deptId; this.mapAddJump = this.$cookies.get("item").backMapZjdAData.deptId;
this.backTheGeom = this.$cookies.get("item").backMapZjdAData.theGeom; this.backTheGeom = this.$cookies.get("item").backMapZjdAData.theGeom;
this.mapZjdData = this.$cookies.get("item").backMapZjdAData;
this.mapZjdTeAll.mapZjdAData = this.$cookies.get("item").backMapZjdAData;
this.zjdHcDy = 1;
this.mapZjdDataTure = 1;
this.mapAddJumpNum =1; this.mapAddJumpNum =1;
this.mapShow(); this.mapShow();
this.getZjdList(); this.getZjdList();
@@ -3448,65 +3452,82 @@


//开始绘制图层- -----start //开始绘制图层- -----start
$("#htMapAll").on("click", function () { $("#htMapAll").on("click", function () {
//删除之前 测距操作添加map中的绘图 --------start
//map.removeLayer(helpTooltip);
map.removeLayer(vector);
map.removeInteraction(draw_cm);
//map.removeOverlay(helpTooltipElement);
map.removeLayer(measureTooltipElement);
//删除之前 测距操作添加map中的绘图 --------end

//删除之前画图图层,重新绘制图层
map.removeInteraction(draw_map);
map.removeLayer(drawing);
//var source = new ol.source.Vector({wrapX: false});
drawing = new ol.layer.Vector({
source: new ol.source.Vector(),
});
map.addLayer(drawing);
if(that.drawingClick) {
that.drawingClick=false;
//删除之前 测距操作添加map中的绘图 --------start
//map.removeLayer(helpTooltip);
map.removeLayer(vector);
map.removeInteraction(draw_cm);
//map.removeOverlay(helpTooltipElement);
map.removeLayer(measureTooltipElement);
//删除之前 测距操作添加map中的绘图 --------end


function addInteraction() {
draw_map = new ol.interaction.Draw({
source: drawing.getSource(),
type: "Polygon",
});
draw_map.on("drawend", function (evt) {
var feature = evt.feature;
var geometry = feature.getGeometry();
that.coordinate = geometry.getCoordinates();
//_this.coordinateList = coordinate.toString();
//提示当前坐标是否绘制完成
if(that.coordinate != "" && that.coordinate !=null) {
that.showhzht = true;
that.htZjdZrzFsss =that.coordinate;
// htMapAllFu();
}else {
$("#htMapAll").trigger("click");
}
//删除之前画图图层,重新绘制图层
map.removeInteraction(draw_map);
map.removeLayer(drawing);
//var source = new ol.source.Vector({wrapX: false});
drawing = new ol.layer.Vector({
source: new ol.source.Vector(),
}); });
map.addInteraction(draw_map);
}
map.addLayer(drawing);


function htMapAllFu() {
//that.drawMapPolygonFun();
//绘制多边形地图
that.$dialog
.confirm({
title: "提示",
message: "是否重新绘制画图",
})
.then(() => {
//$("#drawRemove").trigger("click");
map.removeInteraction(draw_map);
that.coordinate = "";
})
.catch(() => {
//删除画图点
map.removeInteraction(draw_map);
function addInteraction() {
draw_map = new ol.interaction.Draw({
source: drawing.getSource(),
type: "Polygon",
}); });
}
draw_map.on("drawend", function (evt) {
var feature = evt.feature;
var geometry = feature.getGeometry();
that.coordinate = geometry.getCoordinates();
//_this.coordinateList = coordinate.toString();
//提示当前坐标是否绘制完成
if (that.coordinate != "" && that.coordinate != null) {
that.showhzht = true;
that.htZjdZrzFsss = that.coordinate;
// htMapAllFu();
} else {
$("#htMapAll").trigger("click");
}
});
map.addInteraction(draw_map);
}

function htMapAllFu() {
//that.drawMapPolygonFun();
//绘制多边形地图
that.$dialog
.confirm({
title: "提示",
message: "是否重新绘制画图",
})
.then(() => {
//$("#drawRemove").trigger("click");
map.removeInteraction(draw_map);
that.coordinate = "";
})
.catch(() => {
//删除画图点
map.removeInteraction(draw_map);
});
}


addInteraction();
addInteraction();
} else {
that.drawingClick=true;
//删除之前 测距操作添加map中的绘图 --------start
//map.removeLayer(helpTooltip);
map.removeLayer(vector);
map.removeInteraction(draw_cm);
//map.removeOverlay(helpTooltipElement);
map.removeLayer(measureTooltipElement);
//删除之前 测距操作添加map中的绘图 --------end

//删除之前画图图层,重新绘制图层
map.removeInteraction(draw_map);
map.removeLayer(drawing);
//var source = new ol.source.Vector({wrapX: false});
}
}); });
//删除之前绘制图层 //删除之前绘制图层
$("#deleteHistory").on("click", function () { $("#deleteHistory").on("click", function () {
@@ -3557,7 +3578,6 @@
} }
} }
listZjdzd(params).then((response) => { listZjdzd(params).then((response) => {
console.log(response);
if(response.rows.length != 0){ if(response.rows.length != 0){
that.mapDataAll = response.rows; that.mapDataAll = response.rows;
for(var hg=0; hg < that.mapDataAll.length; hg++){ for(var hg=0; hg < that.mapDataAll.length; hg++){
@@ -4381,6 +4401,8 @@
var zb = evt.coordinate; var zb = evt.coordinate;
var url; var url;
var url_bbox; var url_bbox;
//点击空白删除之前图层
map.removeLayer(hc_land_on);
if(that.fsssSx && that.zjdSx && that.zrzSx){ if(that.fsssSx && that.zjdSx && that.zrzSx){
url = wmsSource.getFeatureInfoUrl( url = wmsSource.getFeatureInfoUrl(
evt.coordinate, evt.coordinate,
@@ -4475,9 +4497,9 @@
that.mapZrzData =""; that.mapZrzData ="";
that.mapFsssData =""; that.mapFsssData ="";
//that.mapZjdTeAll.active ="1"; //that.mapZjdTeAll.active ="1";
that.mapZjdTeAll.mapZjdAData ={};
that.mapZjdTeAll.mapZrzAData ={};
that.mapZjdTeAll.mapFsssAData ={};
that.mapZjdTeAll.mapZjdAData ="";
that.mapZjdTeAll.mapZrzAData ="";
that.mapZjdTeAll.mapFsssAData ="";
that.mapZjdDataTure =""; that.mapZjdDataTure ="";
setTimeout(() => { setTimeout(() => {
if ($("#info .featureInfo .featureInfo").text() == "t_house_survey_zjdzd") { if ($("#info .featureInfo .featureInfo").text() == "t_house_survey_zjdzd") {
@@ -4580,7 +4602,7 @@
} else if($("#info .featureInfo .featureInfo").text() == "t_house_survey_zrz"){ } else if($("#info .featureInfo .featureInfo").text() == "t_house_survey_zrz"){
//that.mapZjdTeAll.mapZjdAData ={}; //that.mapZjdTeAll.mapZjdAData ={};
that.mapZjdDataTure=""; that.mapZjdDataTure="";
that.mapZjdTeAll.mapFsssAData ={};
that.mapZjdTeAll.mapFsssAData ="";
map.removeLayer(hc_land_on); map.removeLayer(hc_land_on);
let obj = {}; let obj = {};
that.mapHasDateStatus = 1; that.mapHasDateStatus = 1;
@@ -4644,7 +4666,7 @@
}); });
}); });
} else if($("#info .featureInfo .featureInfo").text() == "t_house_survey_fsss"){ } else if($("#info .featureInfo .featureInfo").text() == "t_house_survey_fsss"){
that.mapZjdTeAll.mapZrzAData ={};
that.mapZjdTeAll.mapZrzAData ="";
that.mapZjdDataTure=""; that.mapZjdDataTure="";
//that.mapZjdTeAll.mapZjdAData ={}; //that.mapZjdTeAll.mapZjdAData ={};
map.removeLayer(hc_land_on); map.removeLayer(hc_land_on);
@@ -5154,6 +5176,7 @@
}, },
//宅基地点击地图核查 //宅基地点击地图核查
zjdHc(){ zjdHc(){
console.log(this.mapZjdTeAll);
if(this.zjdHcDy != "" && this.zjdHcDy != "undefined"){ if(this.zjdHcDy != "" && this.zjdHcDy != "undefined"){
if(this.mapZjdData !=undefined && this.mapZjdData !="" && this.mapZjdDataTure !=""){ if(this.mapZjdData !=undefined && this.mapZjdData !="" && this.mapZjdDataTure !=""){
this.mapZjdTeAll.active =1; this.mapZjdTeAll.active =1;


Loading…
Cancel
Save