Przeglądaj źródła

地图优化

wulanhaote
hbao 3 lat temu
rodzic
commit
755324d675
3 zmienionych plików z 65 dodań i 25 usunięć
  1. +7
    -3
      src/components/Map/MapGisDrawing.vue
  2. +11
    -9
      src/views/homesteadSurvey/add.vue
  3. +47
    -13
      src/views/homesteadSurvey/list.vue

+ 7
- 3
src/components/Map/MapGisDrawing.vue Wyświetl plik

@@ -73,7 +73,11 @@ export default {
var draw; // global so we can remove it later var draw; // global so we can remove it later
var vector_drawing; var vector_drawing;
console.log(that.message); console.log(that.message);
console.log(that.$cookies.get("item"));
// if(that.$cookies.get("item").backMapZjdAData.theGeom !=null && that.$cookies.get("item").backMapZjdAData.theGeom !=""
// && that.$cookies.get("item").backMapZjdAData.theGeom.substring(0,1) =="["){
// console.log(that.$cookies.get("item"));
// that.message = that.$cookies.get("item").backMapZjdAData.theGeom;
// }
getGeoServerConfigKey().then(response => { getGeoServerConfigKey().then(response => {
that.mapGeoServerUrl = response.msg; that.mapGeoServerUrl = response.msg;
if (that.message != null && that.message != "" if (that.message != null && that.message != ""
@@ -597,14 +601,14 @@ export default {
map.addLayer(cunTc); map.addLayer(cunTc);
//村边界查询开始 ------------------------------end //村边界查询开始 ------------------------------end
//宅基地图层查询开始 ------------------start //宅基地图层查询开始 ------------------start
var cql_filter_all = "dept_id='" + that.$cookies.get("item").deptId + "'";
//var cql_filter_all = "dept_id='" + that.$cookies.get("item").deptId + "'";
var zjdTc= new ol.layer.Tile({ var 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: {
LAYERS: 'zjd_dc:t_house_survey_zjdzd', LAYERS: 'zjd_dc:t_house_survey_zjdzd',
TILED: true, TILED: true,
cql_filter: cql_filter_all,
cql_filter: cql_filter,
SRID: 3857, SRID: 3857,
}, },
}), }),


+ 11
- 9
src/views/homesteadSurvey/add.vue Wyświetl plik

@@ -22,7 +22,7 @@
<van-row> <van-row>
<van-col span="4" :offset="1" style="text-align:center;" > <van-col span="4" :offset="1" style="text-align:center;" >
<div @click="active=1"> <div @click="active=1">
<van-icon :name="require('../../assets/images/housesteadSurvey/zjd'+(active==1?'A':'D')+'.png')" size="1rem" :message="form.message" @click="mapClickLoading" style="margin-top:0px;"/>
<van-icon :name="require('../../assets/images/housesteadSurvey/zjd'+(active==1?'A':'D')+'.png')" size="1rem" :message="form.theGeom" @click="mapClickLoading" style="margin-top:0px;"/>
<p :style="{color:(active==1?'rgb(34, 183, 242)':'#000')}">宅基地</p> <p :style="{color:(active==1?'rgb(34, 183, 242)':'#000')}">宅基地</p>
</div> </div>
</van-col> </van-col>
@@ -3208,13 +3208,15 @@
this.isFinished = true this.isFinished = true
} }
this.form = this.cookiesInfo.mapZjdAData; this.form = this.cookiesInfo.mapZjdAData;
this.mapClickLoading();
let zrz = this.cookiesInfo.mapZrzAData; let zrz = this.cookiesInfo.mapZrzAData;
let fsss = this.cookiesInfo.mapFsssAData; let fsss = this.cookiesInfo.mapFsssAData;
this.getnhdmlist();
this.getBaseUrl();
this.getZjd();
// this.getnhdmlist();
// this.getBaseUrl();
// this.getZjd();
if(this.cookiesInfo.active=="3"){ if(this.cookiesInfo.active=="3"){
this.showzrz= true this.showzrz= true
this.form3 =
this.form3.theGeom = this.cookiesInfo.mapZrzAData.theGeom; this.form3.theGeom = this.cookiesInfo.mapZrzAData.theGeom;
this.getZrzList() this.getZrzList()
setTimeout(() => { setTimeout(() => {
@@ -3355,15 +3357,15 @@
this.industryOptions = response.data; this.industryOptions = response.data;
}); });
if(this.active ==1){ if(this.active ==1){
this.form.theGeom = this.item.theGeom;
//this.form.theGeom = this.item.theGeom;
this.message = this.form.theGeom;
console.log(this.message);
//this.$refs.drewingClickLoading = this.form.theGeom;
this.mapClickLoading(); this.mapClickLoading();
} }
}, },
mounted(){ mounted(){
// if(this.active ==1){
// this.form.theGeom = this.item.theGeom;
// this.mapClickLoading();
// }

}, },
methods: { methods: {
showPic(){ showPic(){


+ 47
- 13
src/views/homesteadSurvey/list.vue Wyświetl plik

@@ -15,7 +15,7 @@
</van-nav-bar> </van-nav-bar>
<div style="display:flex;width:94%;margin:0 auto;justify-content:space-between;padding: 10px 0"> <div style="display:flex;width:94%;margin:0 auto;justify-content:space-between;padding: 10px 0">
<div style="display:flex;width:90%;margin:0 auto;"> <div style="display:flex;width:90%;margin:0 auto;">
<div :class="{activeBtn : activeBtn==1,disactiveBtn :activeBtn!=1 }" @click="activeBtn=1"
<div :class="{activeBtn : activeBtn==1,disactiveBtn :activeBtn!=1 }" @click="activeBtn=1,getDc()"
><van-icon size=".3rem" style="vertical-align:middle;" :name="require('../../assets/images/housesteadSurvey/btn1'+(activeBtn!=1?'1':'')+'.png')" /> ><van-icon size=".3rem" style="vertical-align:middle;" :name="require('../../assets/images/housesteadSurvey/btn1'+(activeBtn!=1?'1':'')+'.png')" />
入户核查 入户核查
</div> </div>
@@ -492,6 +492,7 @@
<div id="mapWrapAll" style="width: 100%;height: calc(100vh - 247px);"></div> <div id="mapWrapAll" style="width: 100%;height: calc(100vh - 247px);"></div>
<div id="info" style="display: none"></div> <div id="info" style="display: none"></div>
<div id="deleteHistory" style="display: none"></div> <div id="deleteHistory" style="display: none"></div>
<div id="deleteHistoryMap" style="display: none"></div>
<van-overlay :show="showSearch" @click="closeSearchBox" /> <van-overlay :show="showSearch" @click="closeSearchBox" />
<!--搜索栏目--> <!--搜索栏目-->
<div class="searchBar_wrap" :style="{bottom : bottomHeight}"> <div class="searchBar_wrap" :style="{bottom : bottomHeight}">
@@ -1979,6 +1980,8 @@
}, },
// 查询所有权人 // 查询所有权人
getSyqr(){ getSyqr(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
let params = { let params = {
"deptId" : this.item.deptId "deptId" : this.item.deptId
} }
@@ -2033,6 +2036,8 @@
}, },
// 查询农户列表 // 查询农户列表
getNh(){ getNh(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
let params = { let params = {
"deptId" : this.item.deptId "deptId" : this.item.deptId
} }
@@ -2041,6 +2046,11 @@
this.totalN = response.total this.totalN = response.total
}); });
}, },
//调查
getDc(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
},
// 农户信息搜索框 // 农户信息搜索框
onSearchnh(){ onSearchnh(){
let params = { let params = {
@@ -2798,6 +2808,8 @@
} }
}, },
mapShow() { mapShow() {
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
//通过数据直接查询方式--------加载较慢 start //通过数据直接查询方式--------加载较慢 start
//镇边界获取 //镇边界获取
// listTown().then(response => { // listTown().then(response => {
@@ -3576,6 +3588,18 @@
}); });
//开始绘制图层- -----end //开始绘制图层- -----end


//切换功能删除之前选中状态
$("#deleteHistoryMap").on("click", function () {
map.removeLayer(hc_land_on);
that.mapZjdData = "";
that.mapZrzData = "";
that.mapFsssData = "";
//that.mapZjdTeAll.active ="1";
that.mapZjdTeAll.mapZjdAData = {};
that.mapZjdTeAll.mapZrzAData = {};
that.mapZjdTeAll.mapFsssAData = {};
that.mapZjdDataTure = "";
});
//清除画图鼠标点击事件 //清除画图鼠标点击事件
// $("#drawRemove").click(function () { // $("#drawRemove").click(function () {
// map.removeLayer(drawing); // map.removeLayer(drawing);
@@ -3585,15 +3609,19 @@
//地图定义 //地图定义
var delete_map = ["mapZjd", "mapZrz","mapFsss"]; var delete_map = ["mapZjd", "mapZrz","mapFsss"];
var hc_land_query; var hc_land_query;
var hc_land_queryList =[];
var texiao_layer_zjd; var texiao_layer_zjd;
var texiao_layer_zrz; var texiao_layer_zrz;
var texiao_layer_fsss; var texiao_layer_fsss;
//按照查询条件人名 定位地图-----------------start //按照查询条件人名 定位地图-----------------start
$("#query").on("click", function () { $("#query").on("click", function () {
//数据库查询数据------------------------------------------------------start //数据库查询数据------------------------------------------------------start
$("#deleteHistoryMap").trigger("click");
var val = that.seachText; var val = that.seachText;
//删除之前查询图层 //删除之前查询图层
map.removeLayer(hc_land_query);
//for(var i=0;hc_land_queryList>i;i++){
map.removeLayer(hc_land_query);
//}
that.mapDataAll =[]; that.mapDataAll =[];
if (val == "") { if (val == "") {
that.$toast('请填写查询条件再查询'); that.$toast('请填写查询条件再查询');
@@ -3632,16 +3660,18 @@
that.mapDataAll[hg].typeTc="宅基地"; that.mapDataAll[hg].typeTc="宅基地";
if (that.mapDataAll[hg] !=null && that.mapDataAll[hg].theGeom != null && that.mapDataAll[hg].theGeom != "") { if (that.mapDataAll[hg] !=null && that.mapDataAll[hg].theGeom != null && that.mapDataAll[hg].theGeom != "") {
//that.mapDataAll[hg].createBy = 'mapTheGeomZjdId'; //that.mapDataAll[hg].createBy = 'mapTheGeomZjdId';
hc_land_query = new ol.layer.Vector({
title: "add Layer",
source: new ol.source.Vector({
projection: projection,
features: new ol.format.GeoJSON().readFeatures("{\n" +
" \"type\": \"Feature\",\n" +
" \"geometry\":" + that.mapDataAll[hg].theGeom + ", \"properties\":" + JSON.stringify(that.mapDataAll[hg]) + "}"),
}),
style: styleZjd
});
hc_land_query =
new ol.layer.Vector({
title: "add Layer",
source: new ol.source.Vector({
projection: projection,
features: new ol.format.GeoJSON().readFeatures("{\n" +
" \"type\": \"Feature\",\n" +
" \"geometry\":" + that.mapDataAll[hg].theGeom + ", \"properties\":" + JSON.stringify(that.mapDataAll[hg]) + "}"),
}),
style: styleZjd
});
//hc_land_queryList.push(hc_land_query);
map.addLayer(hc_land_query); map.addLayer(hc_land_query);
var maxXMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxX; var maxXMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxX;
var maxYMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxY; var maxYMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxY;
@@ -3661,6 +3691,7 @@
// that.mapDataAll.push(response.rows); // that.mapDataAll.push(response.rows);
// }); // });
} }
// map.addLayer(hc_land_queryList);
// var mapZrzFor = that.mapDataAll[0].length+1; // var mapZrzFor = that.mapDataAll[0].length+1;
// console.log(mapZrzFor); // console.log(mapZrzFor);
// for(var mapFor=0;mapZrzFor>mapFor;mapFor++){ // for(var mapFor=0;mapZrzFor>mapFor;mapFor++){
@@ -4444,6 +4475,10 @@
if(that.drawingClick) { if(that.drawingClick) {
//点击空白删除之前图层 //点击空白删除之前图层
map.removeLayer(hc_land_on); map.removeLayer(hc_land_on);
//map.removeLayer(hc_land_query);
//for(var i=0;hc_land_query>i;i++){
map.removeLayer(hc_land_query);
//}c
if (that.fsssSx && that.zjdSx && that.zrzSx) { if (that.fsssSx && that.zjdSx && that.zrzSx) {
url = wmsSource.getFeatureInfoUrl( url = wmsSource.getFeatureInfoUrl(
evt.coordinate, evt.coordinate,
@@ -5351,7 +5386,6 @@
zjdTz(){ zjdTz(){
if(this.mapZjdData =="" && this.mapZjdDataTure =="" && this.mapZjdData !=undefined){ if(this.mapZjdData =="" && this.mapZjdDataTure =="" && this.mapZjdData !=undefined){
this.mapZjdTeAll.active =1; this.mapZjdTeAll.active =1;
console.log(this.htZjdZrzFsss);
this.mapZjdTeAll.mapZjdAData.theGeom =this.htZjdZrzFsss; this.mapZjdTeAll.mapZjdAData.theGeom =this.htZjdZrzFsss;
this.mapZjdTeAll.mapZjdAData.deptId = this.$cookies.get("item").deptId; this.mapZjdTeAll.mapZjdAData.deptId = this.$cookies.get("item").deptId;
this.$cookies.set("search",this.mapZjdTeAll); this.$cookies.set("search",this.mapZjdTeAll);


Ładowanie…
Anuluj
Zapisz