绘图点吸附、地图遮罩
parent
f01a465789
commit
672a7e95e6
|
|
@ -35,4 +35,11 @@ export const loginout = () => {
|
|||
url: '/api/Check/Logout',
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
export const checkAuth = () => {
|
||||
return request({
|
||||
url: '/api/Check/GetRoles',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
export const globalApi = {
|
||||
// 本地测试
|
||||
|
||||
// BASE_URL: "http://192.168.10.122:8909", //测试 卢国栋
|
||||
// GEOSERVER_URL: "http://192.168.10.136:8180",
|
||||
// netBASE_URL: "http://123.132.248.154:9231", //测试.net
|
||||
BASE_URL: "http://192.168.10.121:8909", //测试 卢国栋
|
||||
GEOSERVER_URL: "http://192.168.10.121:8180",
|
||||
netBASE_URL: "http://123.132.248.154:9231", //测试.net
|
||||
|
||||
|
||||
// 测试服务器
|
||||
|
|
@ -13,11 +13,11 @@ export const globalApi = {
|
|||
|
||||
|
||||
// 1240 测试服务器
|
||||
BASE_URL: "http://111.17.207.220:9006", //测试 服务器
|
||||
GEOSERVER_URL:"http://111.17.207.220:9007",
|
||||
// BASE_URL: "http://111.17.207.220:9006", //测试 服务器
|
||||
// GEOSERVER_URL:"http://111.17.207.220:9007",
|
||||
// netBASE_URL: "http://111.17.207.220:9001", //测试.net
|
||||
// BASE_URL:"",
|
||||
netBASE_URL:"http://123.132.248.154:9242"
|
||||
// netBASE_URL:"http://123.132.248.154:9242"
|
||||
|
||||
|
||||
//正式环境
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@
|
|||
import { globalApi } from '../../api/urlPatterns.js'
|
||||
// 图形绘制工具类
|
||||
import MapboxDraw from "@mapbox/mapbox-gl-draw"
|
||||
|
||||
import {
|
||||
SnapPolygonMode,
|
||||
SnapPointMode,
|
||||
|
|
@ -376,17 +377,19 @@
|
|||
|
||||
axios({
|
||||
method:"get",
|
||||
url:"http://123.132.248.154:9242/api/FireCodePC/GetLayerInfoByTable",
|
||||
url:globalApi.netBASE_URL+"/api/FireCodePC/GetLayerInfoByTable",
|
||||
params:queryInfo
|
||||
}).then((res)=>{
|
||||
if(res.data.code == 200){
|
||||
if(res.data.data.length>0){
|
||||
this.nearbyGeoJson.features = [];
|
||||
res.data.data.forEach((item,index)=>{
|
||||
let geom = item.geom;
|
||||
let geometry = WKT.parse(geom)
|
||||
let feature = {
|
||||
geometry:geometry,
|
||||
}
|
||||
// console.log("feature"+index,feature.geometry.coordinates);
|
||||
this.nearbyGeoJson.features.push(feature);
|
||||
})
|
||||
}
|
||||
|
|
@ -423,6 +426,7 @@
|
|||
};
|
||||
// 隐藏原有图层
|
||||
this.globalMap.setLayoutProperty("pbfLayer", "visibility", "none");
|
||||
// console.log("nearbyGeoJson",geojson);
|
||||
this.drawTool.add(geojson);
|
||||
},
|
||||
changePo(name) {
|
||||
|
|
@ -555,12 +559,13 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
editByMap() {
|
||||
editByMap(id) {
|
||||
this.currentData.id = id;
|
||||
this.editType = "edit";
|
||||
if (this.drawTool) {
|
||||
return null;
|
||||
}
|
||||
this.getData(parseInt(this.formData.id));
|
||||
this.getData(parseInt(id));
|
||||
this.randomForm = Math.random() * 10000;
|
||||
this.popup ? this.popup.remove() : null;
|
||||
this.isEdit = true;
|
||||
|
|
@ -569,7 +574,7 @@
|
|||
this.editType = "edit";
|
||||
if (this.drawTool) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
this.getData(parseInt(this.currentData.id));
|
||||
this.randomForm = Math.random() * 10000;
|
||||
this.popup ? this.popup.remove() : null;
|
||||
|
|
@ -653,11 +658,9 @@
|
|||
}
|
||||
]
|
||||
};
|
||||
|
||||
// 隐藏PBF图层
|
||||
this.globalMap.setLayoutProperty("pbfLayer", "visibility", "none");
|
||||
this.drawTool.add(geojson);
|
||||
console.log("geojsonnnnnnnnnnnnnnnn",geojson);
|
||||
this.loadNearbyData();
|
||||
},
|
||||
addData() {
|
||||
|
|
@ -738,9 +741,10 @@
|
|||
}
|
||||
// POLYGON MULTIPOLYGON LINESTRING MULTILINESTRING POINT MULTIPOINT
|
||||
let geom = WKT.convert(this.geojson);
|
||||
|
||||
this.formData.tableName = this.layerInfo.tableRef;
|
||||
this.formData.spaceType = this.layerInfo.spaceType;
|
||||
delete this.formData.lng;
|
||||
delete this.formData.lat
|
||||
|
||||
if (this.layerInfo.dataType == '面') {
|
||||
geom = geom.replace("POLYGON ", "MULTIPOLYGON (");
|
||||
|
|
@ -910,8 +914,28 @@
|
|||
minZoom: 5,
|
||||
pitch: 0,
|
||||
// style:"mapbox://styles/mapbox/satellite-v9"
|
||||
style: "mapbox://styles/mapbox/streets-v11"
|
||||
// style: "mapbox://styles/mapbox/streets-v11"
|
||||
// style:"mapbox://styles/mapbox/dark-v10"
|
||||
style: {
|
||||
glyphs: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
|
||||
"version": 8,
|
||||
"sources": {
|
||||
"raster-tiles": {
|
||||
"type": "raster",
|
||||
"tiles": ['https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=b6585bc41ee16251dbe6b1af64f375d9'],
|
||||
"tileSize": 256,
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "tdt-img-tiles",
|
||||
"type": "raster",
|
||||
"source": "raster-tiles",
|
||||
"minzoom": 0,
|
||||
"maxzoom": 22
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -978,7 +1002,7 @@
|
|||
_this.popup.setLngLat(e.lngLat)
|
||||
.setHTML(`
|
||||
<div style="color:#333;padding:3px 12px;cursor:pointer;" type="primary" icon="el-icon-search" onclick="getDetail(${_this.attributeInfo.id})">查看信息</div>
|
||||
<div style="color:#333;padding:3px 12px;cursor:pointer;" type="primary" icon="el-icon-search" onclick="editByMap();">编辑信息</div>
|
||||
<div style="color:#333;padding:3px 12px;cursor:pointer;" type="primary" icon="el-icon-search" onclick="editByMap(${_this.attributeInfo.id});">编辑信息</div>
|
||||
<div style="color:#333;padding:3px 12px;cursor:pointer;" type="primary" icon="el-icon-search" onclick="deleteByContexmenu();">删除数据</div>`)
|
||||
.addTo(_this.globalMap);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { login } from "../../api/login";
|
||||
import { login,checkAuth } from "../../api/login";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -39,15 +39,38 @@ export default {
|
|||
if (res.data.code == 200) {
|
||||
// console.log(res);
|
||||
// localStorage.setItem("X-Token", res.data.msg);
|
||||
|
||||
localStorage.setItem("areaName",res.data.userInfo.areaENName);
|
||||
localStorage.setItem("areaENName",res.data.userInfo.areaENName);
|
||||
localStorage.setItem("X-Token", res.data.token);
|
||||
this.$message.success("登录成功");
|
||||
this.loading = false
|
||||
this.$router.push("/layout");
|
||||
|
||||
this.checkAuth();
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
checkAuth(){
|
||||
checkAuth().then(res=>{
|
||||
if(res.data.code == 200){
|
||||
let checked = false
|
||||
res.data.result.forEach((item)=>{
|
||||
if(item.name == '数据维护'){
|
||||
checked = true
|
||||
}
|
||||
})
|
||||
|
||||
if(checked){
|
||||
this.$message.success("登录成功!");
|
||||
this.loading = false
|
||||
this.$router.push("/layout");
|
||||
}else{
|
||||
this.$message.error("没有权限!");
|
||||
localStorage.clear();
|
||||
this.$router.push("/");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue