Преглед на файлове

优化地图

wulanhaote
hbao преди 3 години
родител
ревизия
527dde6860
променени са 4 файла, в които са добавени 140 реда и са изтрити 77 реда
  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 Целия файл

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

+ 38
- 2
src/components/Map/MapGisDrawing.vue Целия файл

@@ -119,9 +119,16 @@ export default {
}),
});
that.mapData= that.message;
var zjdTc;
var zrzTc;
var fsssTc;
map.removeLayer(zrzTc);
map.removeLayer(zjdTc);
map.removeLayer(fsssTc);
//宅基地图层查询开始 ------------------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({
url: that.mapGeoServerUrl +"/geoserver/zjd_dc/wms",
params: {
@@ -134,6 +141,35 @@ export default {
});
map.addLayer(zjdTc);
//宅基地图层查询开始 ------------------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
if(this.message.substring(0,1) =="{"){
//that.newHt ="1";


+ 11
- 7
src/views/homesteadSurvey/add.vue Целия файл

@@ -3138,6 +3138,7 @@
activeBtn:"",
backMapZjdAData:"",
deptId:"",
zjddm:"",
},
//记录是否从地图进入
enterMap: "",
@@ -3153,6 +3154,7 @@
};
},
created(){
console.log(this.$cookies.get("search"));
if(this.$cookies.get("search")){
if(this.$cookies.get("search").active!=null){
this.cookiesInfo = this.$cookies.get("search")
@@ -3162,7 +3164,9 @@
this.enterMap =1;
this.backMap.backMapZjdAData = this.cookiesInfo.mapZjdAData;
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
this.active = this.cookiesInfo.active;
this.item = this.cookiesInfo.mapZjdAData;
@@ -4138,12 +4142,12 @@
this.showPickerxzkssj= false
},
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){


+ 90
- 67
src/views/homesteadSurvey/list.vue Целия файл

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

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


Зареждане…
Отказ
Запис