ソースを参照

地图优化

wulanhaote
hbao 3年前
コミット
755324d675
3個のファイルの変更65行の追加25行の削除
  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 ファイルの表示

@@ -73,7 +73,11 @@ export default {
var draw; // global so we can remove it later
var vector_drawing;
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 => {
that.mapGeoServerUrl = response.msg;
if (that.message != null && that.message != ""
@@ -597,14 +601,14 @@ export default {
map.addLayer(cunTc);
//村边界查询开始 ------------------------------end
//宅基地图层查询开始 ------------------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({
source: new ol.source.TileWMS({
url: that.mapGeoServerUrl+"/geoserver/zjd_dc/wms",
params: {
LAYERS: 'zjd_dc:t_house_survey_zjdzd',
TILED: true,
cql_filter: cql_filter_all,
cql_filter: cql_filter,
SRID: 3857,
},
}),


+ 11
- 9
src/views/homesteadSurvey/add.vue ファイルの表示

@@ -22,7 +22,7 @@
<van-row>
<van-col span="4" :offset="1" style="text-align:center;" >
<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>
</div>
</van-col>
@@ -3208,13 +3208,15 @@
this.isFinished = true
}
this.form = this.cookiesInfo.mapZjdAData;
this.mapClickLoading();
let zrz = this.cookiesInfo.mapZrzAData;
let fsss = this.cookiesInfo.mapFsssAData;
this.getnhdmlist();
this.getBaseUrl();
this.getZjd();
// this.getnhdmlist();
// this.getBaseUrl();
// this.getZjd();
if(this.cookiesInfo.active=="3"){
this.showzrz= true
this.form3 =
this.form3.theGeom = this.cookiesInfo.mapZrzAData.theGeom;
this.getZrzList()
setTimeout(() => {
@@ -3355,15 +3357,15 @@
this.industryOptions = response.data;
});
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();
}
},
mounted(){
// if(this.active ==1){
// this.form.theGeom = this.item.theGeom;
// this.mapClickLoading();
// }

},
methods: {
showPic(){


+ 47
- 13
src/views/homesteadSurvey/list.vue ファイルの表示

@@ -15,7 +15,7 @@
</van-nav-bar>
<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 :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')" />
入户核查
</div>
@@ -492,6 +492,7 @@
<div id="mapWrapAll" style="width: 100%;height: calc(100vh - 247px);"></div>
<div id="info" style="display: none"></div>
<div id="deleteHistory" style="display: none"></div>
<div id="deleteHistoryMap" style="display: none"></div>
<van-overlay :show="showSearch" @click="closeSearchBox" />
<!--搜索栏目-->
<div class="searchBar_wrap" :style="{bottom : bottomHeight}">
@@ -1979,6 +1980,8 @@
},
// 查询所有权人
getSyqr(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
let params = {
"deptId" : this.item.deptId
}
@@ -2033,6 +2036,8 @@
},
// 查询农户列表
getNh(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
let params = {
"deptId" : this.item.deptId
}
@@ -2041,6 +2046,11 @@
this.totalN = response.total
});
},
//调查
getDc(){
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
},
// 农户信息搜索框
onSearchnh(){
let params = {
@@ -2798,6 +2808,8 @@
}
},
mapShow() {
//删除地图选中状态
$("#deleteHistoryMap").trigger("click");
//通过数据直接查询方式--------加载较慢 start
//镇边界获取
// listTown().then(response => {
@@ -3576,6 +3588,18 @@
});
//开始绘制图层- -----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 () {
// map.removeLayer(drawing);
@@ -3585,15 +3609,19 @@
//地图定义
var delete_map = ["mapZjd", "mapZrz","mapFsss"];
var hc_land_query;
var hc_land_queryList =[];
var texiao_layer_zjd;
var texiao_layer_zrz;
var texiao_layer_fsss;
//按照查询条件人名 定位地图-----------------start
$("#query").on("click", function () {
//数据库查询数据------------------------------------------------------start
$("#deleteHistoryMap").trigger("click");
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 =[];
if (val == "") {
that.$toast('请填写查询条件再查询');
@@ -3632,16 +3660,18 @@
that.mapDataAll[hg].typeTc="宅基地";
if (that.mapDataAll[hg] !=null && that.mapDataAll[hg].theGeom != null && that.mapDataAll[hg].theGeom != "") {
//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);
var maxXMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxX;
var maxYMap = hc_land_query.values_.source.featuresRtree_.rbush_.data.maxY;
@@ -3661,6 +3691,7 @@
// that.mapDataAll.push(response.rows);
// });
}
// map.addLayer(hc_land_queryList);
// var mapZrzFor = that.mapDataAll[0].length+1;
// console.log(mapZrzFor);
// for(var mapFor=0;mapZrzFor>mapFor;mapFor++){
@@ -4444,6 +4475,10 @@
if(that.drawingClick) {
//点击空白删除之前图层
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) {
url = wmsSource.getFeatureInfoUrl(
evt.coordinate,
@@ -5351,7 +5386,6 @@
zjdTz(){
if(this.mapZjdData =="" && this.mapZjdDataTure =="" && this.mapZjdData !=undefined){
this.mapZjdTeAll.active =1;
console.log(this.htZjdZrzFsss);
this.mapZjdTeAll.mapZjdAData.theGeom =this.htZjdZrzFsss;
this.mapZjdTeAll.mapZjdAData.deptId = this.$cookies.get("item").deptId;
this.$cookies.set("search",this.mapZjdTeAll);


読み込み中…
キャンセル
保存