|
@@ -332,18 +332,19 @@ |
|
|
<div id="mapWrap"></div> |
|
|
<div id="mapWrap"></div> |
|
|
<div id='land-btn-wrap'> |
|
|
<div id='land-btn-wrap'> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<input id="drawPolygon" class="ant-btn ant-btn-red" type="button" value="画图"/> |
|
|
|
|
|
<!-- <input id="drawRemove" type="button" class="ant-btn ant-btn-red" value="取消画图"/> --> |
|
|
|
|
|
<input id="drawReset" type="button" class="ant-btn ant-btn-red" value="还原"/> |
|
|
|
|
|
|
|
|
<input id="drawPolygon" class="ant-btn ant-btn-red" type="button" value="开启画图"/> |
|
|
|
|
|
<!--<input id="drawRemove" type="button" class="ant-btn ant-btn-red" value="关闭画图"/> --> |
|
|
|
|
|
<input id="drawReset" type="button" class="ant-btn ant-btn-red" value="还原图层"/> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" v-if="diglogStatus" @click="submitFormMap">确 定</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitFormMap">确 定</el-button> |
|
|
<el-button type="danger" @click="clearMapLayer">清除图层</el-button> |
|
|
<el-button type="danger" @click="clearMapLayer">清除图层</el-button> |
|
|
<el-button @click="cancelMap">关 闭</el-button> |
|
|
<el-button @click="cancelMap">关 闭</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@@ -357,14 +358,13 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css" |
|
|
import "splitpanes/dist/splitpanes.css" |
|
|
import "splitpanes/dist/splitpanes.css" |
|
|
import { deptTreeSelect } from "@/api/system/user" |
|
|
import { deptTreeSelect } from "@/api/system/user" |
|
|
import {getConfigKey} from "@/api/system/config"; |
|
|
import {getConfigKey} from "@/api/system/config"; |
|
|
import {getDept,getInfoByImportCode} from "@/api/system/dept"; |
|
|
|
|
|
import MapField from "@/components/house/MapField"; |
|
|
|
|
|
|
|
|
import {getDept, getInfoByImportCode} from "@/api/system/dept"; |
|
|
import $ from "jquery"; |
|
|
import $ from "jquery"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "Land", |
|
|
name: "Land", |
|
|
dicts: ['ownership_type', 'land_use_type', 'survey_status', 'is_common', 'land_grade_type', 'land_type', 'land_use'], |
|
|
dicts: ['ownership_type', 'land_use_type', 'survey_status', 'is_common', 'land_grade_type', 'land_type', 'land_use'], |
|
|
components: { Treeselect, Splitpanes, Pane,MapField }, |
|
|
|
|
|
|
|
|
components: { Treeselect, Splitpanes, Pane }, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
// 遮罩层 |
|
|
// 遮罩层 |
|
@@ -407,15 +407,13 @@ export default { |
|
|
children: "children", |
|
|
children: "children", |
|
|
label: "label" |
|
|
label: "label" |
|
|
}, |
|
|
}, |
|
|
// 遮罩按钮新增点击状态 |
|
|
|
|
|
diglogStatus: true, |
|
|
|
|
|
//地图 |
|
|
|
|
|
|
|
|
//地图参数 |
|
|
openMap: false, |
|
|
openMap: false, |
|
|
mapTheGeomId: null, |
|
|
mapTheGeomId: null, |
|
|
mapTheGeom: null, |
|
|
mapTheGeom: null, |
|
|
drawInsert:null, |
|
|
drawInsert:null, |
|
|
tGeoOrganizationLng: null, |
|
|
|
|
|
tGeoOrganizationLat: null, |
|
|
|
|
|
|
|
|
jingdu: null, |
|
|
|
|
|
weidu: null, |
|
|
// 查询参数 |
|
|
// 查询参数 |
|
|
queryParams: { |
|
|
queryParams: { |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
@@ -447,7 +445,6 @@ export default { |
|
|
scmjm: [ |
|
|
scmjm: [ |
|
|
{ required: true, message: "实测面积不能为空", trigger: "blur" } |
|
|
{ required: true, message: "实测面积不能为空", trigger: "blur" } |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// EXCEL导入 |
|
|
// EXCEL导入 |
|
|
upload: { |
|
|
upload: { |
|
@@ -464,7 +461,6 @@ export default { |
|
|
// 上传的地址 |
|
|
// 上传的地址 |
|
|
url: process.env.VUE_APP_BASE_API + "/resource/land/importData" |
|
|
url: process.env.VUE_APP_BASE_API + "/resource/land/importData" |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@@ -476,6 +472,7 @@ export default { |
|
|
created() { |
|
|
created() { |
|
|
this.getDeptTree() |
|
|
this.getDeptTree() |
|
|
this.getList() |
|
|
this.getList() |
|
|
|
|
|
|
|
|
// 获取geoserver的地址 |
|
|
// 获取geoserver的地址 |
|
|
this.getGeoServerUrl(); |
|
|
this.getGeoServerUrl(); |
|
|
// 获取地块图层名称 |
|
|
// 获取地块图层名称 |
|
@@ -500,7 +497,7 @@ export default { |
|
|
this.open = false |
|
|
this.open = false |
|
|
this.reset() |
|
|
this.reset() |
|
|
}, |
|
|
}, |
|
|
// 取消按钮 |
|
|
|
|
|
|
|
|
// 取消地图按钮 |
|
|
cancelMap() { |
|
|
cancelMap() { |
|
|
this.openMap = false; |
|
|
this.openMap = false; |
|
|
this.reset(); |
|
|
this.reset(); |
|
@@ -535,7 +532,6 @@ export default { |
|
|
deptName: null, |
|
|
deptName: null, |
|
|
sfzwd: '2' |
|
|
sfzwd: '2' |
|
|
} |
|
|
} |
|
|
this.diglogStatus = true; |
|
|
|
|
|
this.resetForm("form") |
|
|
this.resetForm("form") |
|
|
}, |
|
|
}, |
|
|
/** 搜索按钮操作 */ |
|
|
/** 搜索按钮操作 */ |
|
@@ -772,8 +768,8 @@ export default { |
|
|
getDept(deptId).then(response => { |
|
|
getDept(deptId).then(response => { |
|
|
let insertCode = response.data; |
|
|
let insertCode = response.data; |
|
|
if (insertCode != null) { |
|
|
if (insertCode != null) { |
|
|
this.tGeoOrganizationLat = insertCode.latitude; |
|
|
|
|
|
this.tGeoOrganizationLng = insertCode.longitude; |
|
|
|
|
|
|
|
|
this.weidu = insertCode.latitude; |
|
|
|
|
|
this.jingdu = insertCode.longitude; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@@ -783,8 +779,8 @@ export default { |
|
|
getInfoByImportCode(row.importCode).then((res) => { |
|
|
getInfoByImportCode(row.importCode).then((res) => { |
|
|
let insertCode = res.data; |
|
|
let insertCode = res.data; |
|
|
if (insertCode != null) { |
|
|
if (insertCode != null) { |
|
|
this.tGeoOrganizationLat = insertCode.latitude; |
|
|
|
|
|
this.tGeoOrganizationLng = insertCode.longitude; |
|
|
|
|
|
|
|
|
this.weidu = insertCode.latitude; |
|
|
|
|
|
this.jingdu = insertCode.longitude; |
|
|
} |
|
|
} |
|
|
const tableRow = { importCode: row.importCode }; |
|
|
const tableRow = { importCode: row.importCode }; |
|
|
listLandQuery(tableRow).then(response => { |
|
|
listLandQuery(tableRow).then(response => { |
|
@@ -798,43 +794,40 @@ export default { |
|
|
}, |
|
|
}, |
|
|
/** 地图提交按钮 */ |
|
|
/** 地图提交按钮 */ |
|
|
submitFormMap() { |
|
|
submitFormMap() { |
|
|
this.diglogStatus = false; |
|
|
|
|
|
if(this.drawInsert !=null && this.drawInsert !=""){ |
|
|
if(this.drawInsert !=null && this.drawInsert !=""){ |
|
|
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); |
|
|
this.mapTheGeomId.theGeom = JSON.stringify(this.drawInsert); |
|
|
}else{ |
|
|
}else{ |
|
|
this.mapTheGeomId.theGeom = this.mapTheGeomId.theGeomText |
|
|
this.mapTheGeomId.theGeom = this.mapTheGeomId.theGeomText |
|
|
} |
|
|
} |
|
|
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid,theGeom: this.mapTheGeomId.theGeom }; |
|
|
|
|
|
|
|
|
let sysGis = { tableName: 't_resource_land', priId: 'fid', id: this.mapTheGeomId.fid, theGeom: this.mapTheGeomId.theGeom }; |
|
|
if (this.mapTheGeomId != null) { |
|
|
if (this.mapTheGeomId != null) { |
|
|
areaSavePri(sysGis).then(response => { |
|
|
areaSavePri(sysGis).then(response => { |
|
|
this.$modal.msgSuccess("修改成功"); |
|
|
this.$modal.msgSuccess("修改成功"); |
|
|
this.openMap = false; |
|
|
this.openMap = false; |
|
|
this.getList(); |
|
|
|
|
|
this.diglogStatus = true; |
|
|
|
|
|
|
|
|
//this.getList(); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
/** 清除坐标点图层 */ |
|
|
/** 清除坐标点图层 */ |
|
|
clearMapLayer() { |
|
|
clearMapLayer() { |
|
|
let sysGis = { tableName: 't_resource_land',priId: 'fid',id: this.mapTheGeomId.fid}; |
|
|
|
|
|
|
|
|
let sysGis = { tableName: 't_resource_land', priId: 'fid', id: this.mapTheGeomId.fid}; |
|
|
cleanSavePri(sysGis).then(response => { |
|
|
cleanSavePri(sysGis).then(response => { |
|
|
this.$modal.msgSuccess("清除成功"); |
|
|
this.$modal.msgSuccess("清除成功"); |
|
|
this.openMap = false; |
|
|
this.openMap = false; |
|
|
this.getList(); |
|
|
|
|
|
|
|
|
//this.getList(); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
pointDarw(resourceList) { |
|
|
pointDarw(resourceList) { |
|
|
//加载地图编辑 |
|
|
//加载地图编辑 |
|
|
var that = this; |
|
|
var that = this; |
|
|
var map; |
|
|
var map; |
|
|
//var hc_land; |
|
|
|
|
|
var draw; // global so we can remove it later |
|
|
|
|
|
|
|
|
var draw; |
|
|
var vector_drawing; |
|
|
var vector_drawing; |
|
|
var startDarw =false; |
|
|
var startDarw =false; |
|
|
var openDarw = false; |
|
|
var openDarw = false; |
|
|
this.mapTheGeomId = resourceList.find((land) => { |
|
|
this.mapTheGeomId = resourceList.find((land) => { |
|
|
//model就是上面的数据源 |
|
|
//model就是上面的数据源 |
|
|
return land.fid === this.mapTheGeomId.fid; //筛选出匹配数据 |
|
|
|
|
|
|
|
|
return land.fid === this.mapTheGeomId.fid; |
|
|
}); |
|
|
}); |
|
|
if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != "" |
|
|
if (this.mapTheGeomId.theGeom != null && this.mapTheGeomId.theGeom != "" |
|
|
&& this.mapTheGeomId.theGeom != undefined) { |
|
|
&& this.mapTheGeomId.theGeom != undefined) { |
|
@@ -844,9 +837,10 @@ export default { |
|
|
startDarw = false; |
|
|
startDarw = false; |
|
|
openDarw = true; |
|
|
openDarw = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (startDarw) { |
|
|
if (startDarw) { |
|
|
document.getElementById("mapWrap").innerHTML = ''; |
|
|
document.getElementById("mapWrap").innerHTML = ''; |
|
|
var hc_land; |
|
|
|
|
|
|
|
|
var thePolygon; |
|
|
var draw; // global so we can remove it later |
|
|
var draw; // global so we can remove it later |
|
|
var vector_drawing; |
|
|
var vector_drawing; |
|
|
var projection = new ol.proj.Projection({ |
|
|
var projection = new ol.proj.Projection({ |
|
@@ -855,7 +849,6 @@ export default { |
|
|
units: "degrees", |
|
|
units: "degrees", |
|
|
//extent:extent |
|
|
//extent:extent |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var aerial = new ol.layer.Tile({ |
|
|
var aerial = new ol.layer.Tile({ |
|
|
source: new ol.source.XYZ({ |
|
|
source: new ol.source.XYZ({ |
|
|
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + |
|
|
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + |
|
@@ -865,7 +858,6 @@ export default { |
|
|
isGroup: true, |
|
|
isGroup: true, |
|
|
name: "卫星影像图", |
|
|
name: "卫星影像图", |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var yingxzi = new ol.layer.Tile({ |
|
|
var yingxzi = new ol.layer.Tile({ |
|
|
source: new ol.source.XYZ({ |
|
|
source: new ol.source.XYZ({ |
|
|
url: "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", |
|
|
url: "https://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", |
|
@@ -882,8 +874,8 @@ export default { |
|
|
view: new ol.View({ |
|
|
view: new ol.View({ |
|
|
//center: ol.proj.fromLonLat([115.452752, 31.789033]), |
|
|
//center: ol.proj.fromLonLat([115.452752, 31.789033]), |
|
|
zoom: 17.8, |
|
|
zoom: 17.8, |
|
|
minZoom: 0, //地图缩小限制 |
|
|
|
|
|
maxZoom: 18.3, //地图放大限制 |
|
|
|
|
|
|
|
|
minZoom: 0, |
|
|
|
|
|
maxZoom: 18.3, |
|
|
}), |
|
|
}), |
|
|
}); |
|
|
}); |
|
|
// 添加村边界 |
|
|
// 添加村边界 |
|
@@ -899,7 +891,6 @@ export default { |
|
|
name: 'villageBorderLayer' |
|
|
name: 'villageBorderLayer' |
|
|
}); |
|
|
}); |
|
|
map.addLayer(mapBorder); |
|
|
map.addLayer(mapBorder); |
|
|
|
|
|
|
|
|
// 添加已经存在的资源图层 |
|
|
// 添加已经存在的资源图层 |
|
|
let vectorSource = new ol.source.Vector(); |
|
|
let vectorSource = new ol.source.Vector(); |
|
|
for (let resource of resourceList) { |
|
|
for (let resource of resourceList) { |
|
@@ -911,7 +902,6 @@ export default { |
|
|
vectorSource.addFeature(feature); |
|
|
vectorSource.addFeature(feature); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let resourceLayer = new ol.layer.Vector({ |
|
|
let resourceLayer = new ol.layer.Vector({ |
|
|
source: vectorSource, |
|
|
source: vectorSource, |
|
|
style: (feature, resolution) => { |
|
|
style: (feature, resolution) => { |
|
@@ -929,8 +919,8 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
map.addLayer(resourceLayer); |
|
|
map.addLayer(resourceLayer); |
|
|
//图层查询定位开始 ---------start |
|
|
|
|
|
hc_land = new ol.layer.Vector({ |
|
|
|
|
|
|
|
|
//当前图层查询定位 |
|
|
|
|
|
thePolygon = new ol.layer.Vector({ |
|
|
title: "add Layer", |
|
|
title: "add Layer", |
|
|
source: new ol.source.Vector({ |
|
|
source: new ol.source.Vector({ |
|
|
projection: projection, |
|
|
projection: projection, |
|
@@ -950,24 +940,21 @@ export default { |
|
|
}), |
|
|
}), |
|
|
}), |
|
|
}), |
|
|
}); |
|
|
}); |
|
|
map.addLayer(hc_land); |
|
|
|
|
|
var maxXMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxX; |
|
|
|
|
|
var maxYMap = hc_land.values_.source.featuresRtree_.rbush_.data.maxY; |
|
|
|
|
|
var minXMap = hc_land.values_.source.featuresRtree_.rbush_.data.minX; |
|
|
|
|
|
var minYMap = hc_land.values_.source.featuresRtree_.rbush_.data.minY; |
|
|
|
|
|
//定位查询位置 |
|
|
|
|
|
var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); //获取边界区域的中心位置 |
|
|
|
|
|
|
|
|
map.addLayer(thePolygon); |
|
|
|
|
|
var maxXMap = thePolygon.values_.source.featuresRtree_.rbush_.data.maxX; |
|
|
|
|
|
var maxYMap = thePolygon.values_.source.featuresRtree_.rbush_.data.maxY; |
|
|
|
|
|
var minXMap = thePolygon.values_.source.featuresRtree_.rbush_.data.minX; |
|
|
|
|
|
var minYMap = thePolygon.values_.source.featuresRtree_.rbush_.data.minY; |
|
|
|
|
|
var center = ol.extent.getCenter([maxXMap, maxYMap, minXMap, minYMap]); |
|
|
map.getView().animate({ |
|
|
map.getView().animate({ |
|
|
// 只设置需要的属性即可 |
|
|
|
|
|
center: center, // 中心点 |
|
|
|
|
|
zoom: 17.8, // 缩放级别 |
|
|
|
|
|
rotation: undefined, // 缩放完成view视图旋转弧度 |
|
|
|
|
|
duration: 1000, // 缩放持续时间,默认不需要设置 |
|
|
|
|
|
|
|
|
center: center, |
|
|
|
|
|
zoom: 17.8, |
|
|
|
|
|
rotation: undefined, |
|
|
|
|
|
duration: 1000, |
|
|
}); |
|
|
}); |
|
|
//图层查询定位结束 ---------end |
|
|
|
|
|
//开始绘制地图 |
|
|
//开始绘制地图 |
|
|
$("#drawPolygon").off("click").on("click", function () { |
|
|
$("#drawPolygon").off("click").on("click", function () { |
|
|
map.removeLayer(hc_land); |
|
|
|
|
|
|
|
|
map.removeLayer(thePolygon); |
|
|
map.removeLayer(vector_drawing); |
|
|
map.removeLayer(vector_drawing); |
|
|
that.drawInsert = null; |
|
|
that.drawInsert = null; |
|
|
//var source = new ol.source.Vector({wrapX: false}); |
|
|
//var source = new ol.source.Vector({wrapX: false}); |
|
@@ -975,7 +962,6 @@ export default { |
|
|
source: new ol.source.Vector(), |
|
|
source: new ol.source.Vector(), |
|
|
}); |
|
|
}); |
|
|
map.addLayer(vector_drawing); |
|
|
map.addLayer(vector_drawing); |
|
|
|
|
|
|
|
|
function addInteraction() { |
|
|
function addInteraction() { |
|
|
draw = new ol.interaction.Draw({ |
|
|
draw = new ol.interaction.Draw({ |
|
|
source: vector_drawing.getSource(), |
|
|
source: vector_drawing.getSource(), |
|
@@ -990,12 +976,11 @@ export default { |
|
|
}); |
|
|
}); |
|
|
map.addInteraction(draw); |
|
|
map.addInteraction(draw); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
addInteraction(); |
|
|
addInteraction(); |
|
|
}); |
|
|
}); |
|
|
//清除画图鼠标点击事件 |
|
|
//清除画图鼠标点击事件 |
|
|
$("#drawRemove").off("click").on("click", function () { |
|
|
$("#drawRemove").off("click").on("click", function () { |
|
|
//map.addLayer(hc_land); |
|
|
|
|
|
|
|
|
//map.addLayer(thePolygon); |
|
|
map.removeInteraction(draw); |
|
|
map.removeInteraction(draw); |
|
|
//map.removeLayer(vector_drawing); |
|
|
//map.removeLayer(vector_drawing); |
|
|
}); |
|
|
}); |
|
@@ -1003,10 +988,11 @@ export default { |
|
|
$("#drawReset").off("click").on("click", function () { |
|
|
$("#drawReset").off("click").on("click", function () { |
|
|
map.removeInteraction(draw); |
|
|
map.removeInteraction(draw); |
|
|
map.removeLayer(vector_drawing); |
|
|
map.removeLayer(vector_drawing); |
|
|
map.addLayer(hc_land); |
|
|
|
|
|
|
|
|
map.addLayer(thePolygon); |
|
|
that.drawInsert = null; |
|
|
that.drawInsert = null; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (openDarw) { |
|
|
if (openDarw) { |
|
|
document.getElementById("mapWrap").innerHTML = ''; |
|
|
document.getElementById("mapWrap").innerHTML = ''; |
|
|
var projection = new ol.proj.Projection({ |
|
|
var projection = new ol.proj.Projection({ |
|
@@ -1015,7 +1001,6 @@ export default { |
|
|
units: "degrees", |
|
|
units: "degrees", |
|
|
//extent:extent |
|
|
//extent:extent |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
var aerial = new ol.layer.Tile({ |
|
|
var aerial = new ol.layer.Tile({ |
|
|
source: new ol.source.XYZ({ |
|
|
source: new ol.source.XYZ({ |
|
|
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + |
|
|
url: "http://t0.tianditu.gov.cn/img_w/wmts?" + |
|
@@ -1035,9 +1020,8 @@ export default { |
|
|
}); |
|
|
}); |
|
|
//获取坐标是否存在 |
|
|
//获取坐标是否存在 |
|
|
var Zb; |
|
|
var Zb; |
|
|
if (this.tGeoOrganizationLng != null && this.tGeoOrganizationLat != null && this.tGeoOrganizationLng !="" |
|
|
|
|
|
&& this.tGeoOrganizationLat !="" && this.tGeoOrganizationLng !=undefined && this.tGeoOrganizationLat !=undefined) { |
|
|
|
|
|
Zb = [this.tGeoOrganizationLng, this.tGeoOrganizationLat] |
|
|
|
|
|
|
|
|
if (this.jingdu != null && this.jingdu !="") { |
|
|
|
|
|
Zb = [this.jingdu, this.weidu] |
|
|
} else { |
|
|
} else { |
|
|
Zb = [115.452752, 31.789033]; |
|
|
Zb = [115.452752, 31.789033]; |
|
|
} |
|
|
} |
|
@@ -1069,7 +1053,6 @@ export default { |
|
|
name: 'villageBorderLayer' |
|
|
name: 'villageBorderLayer' |
|
|
}); |
|
|
}); |
|
|
map.addLayer(mapBorder); |
|
|
map.addLayer(mapBorder); |
|
|
|
|
|
|
|
|
// 添加已经存在的资源图层 |
|
|
// 添加已经存在的资源图层 |
|
|
let vectorSource = new ol.source.Vector(); |
|
|
let vectorSource = new ol.source.Vector(); |
|
|
for (let resource of resourceList) { |
|
|
for (let resource of resourceList) { |
|
@@ -1081,7 +1064,6 @@ export default { |
|
|
vectorSource.addFeature(feature); |
|
|
vectorSource.addFeature(feature); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let resourceLayer = new ol.layer.Vector({ |
|
|
let resourceLayer = new ol.layer.Vector({ |
|
|
source: vectorSource, |
|
|
source: vectorSource, |
|
|
style: (feature, resolution) => { |
|
|
style: (feature, resolution) => { |
|
@@ -1100,10 +1082,9 @@ export default { |
|
|
}); |
|
|
}); |
|
|
map.addLayer(resourceLayer); |
|
|
map.addLayer(resourceLayer); |
|
|
|
|
|
|
|
|
//图层查询定位结束 ---------end |
|
|
|
|
|
//开始绘制地图 |
|
|
//开始绘制地图 |
|
|
$("#drawPolygon").off("click").on("click", function () { |
|
|
$("#drawPolygon").off("click").on("click", function () { |
|
|
//map.removeLayer(hc_land); |
|
|
|
|
|
|
|
|
//map.removeLayer(thePolygon); |
|
|
map.removeLayer(vector_drawing); |
|
|
map.removeLayer(vector_drawing); |
|
|
that.drawInsert = null; |
|
|
that.drawInsert = null; |
|
|
map.removeInteraction(draw); |
|
|
map.removeInteraction(draw); |
|
@@ -1130,20 +1111,21 @@ export default { |
|
|
}); |
|
|
}); |
|
|
map.addInteraction(draw); |
|
|
map.addInteraction(draw); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
addInteraction(); |
|
|
addInteraction(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//清除画图鼠标点击事件 |
|
|
//清除画图鼠标点击事件 |
|
|
$("#drawRemove").off("click").on("click", function () { |
|
|
$("#drawRemove").off("click").on("click", function () { |
|
|
//map.addLayer(hc_land); |
|
|
|
|
|
|
|
|
//map.addLayer(thePolygon); |
|
|
map.removeInteraction(draw); |
|
|
map.removeInteraction(draw); |
|
|
//map.removeLayer(vector_drawing); |
|
|
//map.removeLayer(vector_drawing); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//还原之前图层 |
|
|
//还原之前图层 |
|
|
$("#drawReset").off("click").on("click", function () { |
|
|
$("#drawReset").off("click").on("click", function () { |
|
|
map.removeInteraction(draw); |
|
|
map.removeInteraction(draw); |
|
|
map.removeLayer(vector_drawing); |
|
|
map.removeLayer(vector_drawing); |
|
|
//map.addLayer(hc_land); |
|
|
|
|
|
|
|
|
//map.addLayer(thePolygon); |
|
|
that.drawInsert = null; |
|
|
that.drawInsert = null; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@@ -1156,6 +1138,7 @@ export default { |
|
|
height: 75vh; |
|
|
height: 75vh; |
|
|
overflow-y: scroll; |
|
|
overflow-y: scroll; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#land-btn-wrap { |
|
|
#land-btn-wrap { |
|
|
position: relative; |
|
|
position: relative; |
|
|
width: 40%; |
|
|
width: 40%; |
|
@@ -1163,7 +1146,6 @@ export default { |
|
|
bottom: 95%; |
|
|
bottom: 95%; |
|
|
z-index: 2000; |
|
|
z-index: 2000; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#mapWrap { |
|
|
#mapWrap { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
|