|
@@ -24,7 +24,7 @@ export default {
|
|
|
CaseAuditPopup,
|
|
|
NormalAttrPopup,
|
|
|
LabelCasePopup,
|
|
|
- BasemapChange
|
|
|
+ BasemapChange,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
currentLabelHtml: null,
|
|
|
tableObj: {},
|
|
|
// 疑点审计的保存后的疑点状态集合
|
|
|
- caseStatusMap: new Map()
|
|
|
+ caseStatusMap: new Map(),
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
deleteSinglePolygon: this.deleteSinglePolygon,
|
|
|
deleteGroupFromMap: this.deleteGroupFromMap,
|
|
|
drawGeometry: this.drawGeometry,
|
|
|
- deleteGeometry: this.deleteGeometry
|
|
|
+ deleteGeometry: this.deleteGeometry,
|
|
|
});
|
|
|
},
|
|
|
beforeDestroyed() {
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
// 监听当前菜单
|
|
|
getCurrentMenu() {
|
|
|
return this.$store.state.navSelect;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
getLabelCaseBtnStatus(val) {
|
|
@@ -141,9 +141,9 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.getJSonData();
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
// immediate: true
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 开始标记疑点事件
|
|
@@ -154,7 +154,7 @@ export default {
|
|
|
stopLabelCase() {
|
|
|
if (map2DViewer.measureTool) {
|
|
|
map2DViewer.setDrawTool({
|
|
|
- action: "remove"
|
|
|
+ action: "remove",
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -173,16 +173,19 @@ export default {
|
|
|
let geoProperties = JSON.parse(geojsonData).properties;
|
|
|
// 搜索geojson数据中的固定字段 -- 镇域名称,面积,土地类型,图斑编号
|
|
|
this.$refs.normalRef.tableObj["面积"] = geoProperties["面积"] || "--";
|
|
|
- this.$refs.normalRef.tableObj["镇域名称"] = geoProperties["镇域名称"] || "--";
|
|
|
- this.$refs.normalRef.tableObj["土地类型"] = geoProperties["土地类型"] || "--";
|
|
|
- this.$refs.normalRef.tableObj["图斑编号"] = geoProperties["图斑编号"] || "--";
|
|
|
+ this.$refs.normalRef.tableObj["镇域名称"] =
|
|
|
+ geoProperties["镇域名称"] || "--";
|
|
|
+ this.$refs.normalRef.tableObj["土地类型"] =
|
|
|
+ geoProperties["土地类型"] || "--";
|
|
|
+ this.$refs.normalRef.tableObj["图斑编号"] =
|
|
|
+ geoProperties["图斑编号"] || "--";
|
|
|
let currentInnerHtml = this.$refs.normalRef.$el.innerHTML;
|
|
|
// 需要重新绘制的属性obj
|
|
|
let targetObj = {
|
|
|
镇域名称: geoProperties["镇域名称"] || "--",
|
|
|
面积: geoProperties["面积"] || "--",
|
|
|
土地类型: geoProperties["土地类型"] || "--",
|
|
|
- 图斑编号: geoProperties["图斑编号"] || "--"
|
|
|
+ 图斑编号: geoProperties["图斑编号"] || "--",
|
|
|
};
|
|
|
|
|
|
if (currentInnerHtml) {
|
|
@@ -198,21 +201,27 @@ export default {
|
|
|
if ($(`#${str}_id a`)) {
|
|
|
// 属性框内容
|
|
|
if ($(".center-table-item-normal")) {
|
|
|
- $(".center-table-item-normal .leftcell").each((index, domEle) => {
|
|
|
- $(".center-table-item-normal .leftcell").eq(index).text(Object.keys(targetObj)[index]);
|
|
|
- $(".center-table-item-normal .rightcell").eq(index).text(Object.values(targetObj)[index]);
|
|
|
- });
|
|
|
+ $(".center-table-item-normal .leftcell").each(
|
|
|
+ (index, domEle) => {
|
|
|
+ $(".center-table-item-normal .leftcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.keys(targetObj)[index]);
|
|
|
+ $(".center-table-item-normal .rightcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.values(targetObj)[index]);
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
$(`#${str}_id a`)
|
|
|
.eq(0)
|
|
|
- .click(e => {
|
|
|
+ .click((e) => {
|
|
|
this.$store.state.lawPopupShow = true;
|
|
|
this.$store.state.lawSourceType = sourceType;
|
|
|
});
|
|
|
$(`#${str}_id a`)
|
|
|
.eq(1)
|
|
|
- .click(e => {
|
|
|
+ .click((e) => {
|
|
|
// 触发综合分析右侧面板点击事件
|
|
|
this.$bus.$emit("viewDetailsPopup", geojsonData);
|
|
|
});
|
|
@@ -225,7 +234,7 @@ export default {
|
|
|
$(`#${str}_id a`).remove();
|
|
|
}
|
|
|
});
|
|
|
- console.log("呈现我的模型的几何数据");
|
|
|
+ // console.log("呈现我的模型的几何数据");
|
|
|
}
|
|
|
|
|
|
return div;
|
|
@@ -243,8 +252,10 @@ export default {
|
|
|
let geoProperties = JSON.parse(geojsonData).properties;
|
|
|
// 搜索geojson数据中的固定字段 -- 镇域名称,面积,土地类型,图斑编号
|
|
|
this.$refs.auditRef.tableObj["面积"] = geoProperties["面积"] || "--";
|
|
|
- this.$refs.auditRef.tableObj["镇域名称"] = geoProperties["镇域名称"] || "--";
|
|
|
- this.$refs.auditRef.tableObj["图层构成"] = geoProperties["图层构成"] || "--";
|
|
|
+ this.$refs.auditRef.tableObj["镇域名称"] =
|
|
|
+ geoProperties["镇域名称"] || "--";
|
|
|
+ this.$refs.auditRef.tableObj["图层构成"] =
|
|
|
+ geoProperties["图层构成"] || "--";
|
|
|
this.$refs.auditRef.tableObj["性质"] = geoProperties["性质"] || "--";
|
|
|
|
|
|
// 需要重新绘制的属性obj
|
|
@@ -252,7 +263,7 @@ export default {
|
|
|
镇域名称: geoProperties["镇域名称"] || "--",
|
|
|
面积: geoProperties["面积"] || "--",
|
|
|
图层构成: geoProperties["图层构成"] || "--",
|
|
|
- 性质: geoProperties["性质"] || "--"
|
|
|
+ 性质: geoProperties["性质"] || "--",
|
|
|
};
|
|
|
if (this.currentHtml) {
|
|
|
let div = document.createElement("div");
|
|
@@ -264,22 +275,32 @@ export default {
|
|
|
// 属性框内容
|
|
|
if ($(".center-table-item-normal")) {
|
|
|
$(".center-table-item-normal .leftcell").each((index, domEle) => {
|
|
|
- $(".center-table-item-normal .leftcell").eq(index).text(Object.keys(targetObj)[index]);
|
|
|
- $(".center-table-item-normal .rightcell").eq(index).text(Object.values(targetObj)[index]);
|
|
|
+ $(".center-table-item-normal .leftcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.keys(targetObj)[index]);
|
|
|
+ $(".center-table-item-normal .rightcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.values(targetObj)[index]);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if ($(".center-table-item-special")) {
|
|
|
$(".center-table-item-special .leftcell").each((index, domEle) => {
|
|
|
- $(".center-table-item-speciall .leftcell").eq(index).text(Object.keys(targetObj)[index]);
|
|
|
- $(".center-table-item-special .rightcell").eq(index).text(Object.values(targetObj)[index]);
|
|
|
+ $(".center-table-item-speciall .leftcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.keys(targetObj)[index]);
|
|
|
+ $(".center-table-item-special .rightcell")
|
|
|
+ .eq(index)
|
|
|
+ .text(Object.values(targetObj)[index]);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 下拉框内容
|
|
|
if ($(`#${str}_id .center-table-item-special select`)) {
|
|
|
if (this.caseStatusMap.has(str)) {
|
|
|
- $(`#${str}_id .center-table-item-special select`).val(this.caseStatusMap.get(str));
|
|
|
+ $(`#${str}_id .center-table-item-special select`).val(
|
|
|
+ this.caseStatusMap.get(str)
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -287,13 +308,13 @@ export default {
|
|
|
if ($(`#${str}_id a`)) {
|
|
|
$(`#${str}_id a`)
|
|
|
.eq(0)
|
|
|
- .click(e => {
|
|
|
+ .click((e) => {
|
|
|
this.$store.state.lawPopupShow = true;
|
|
|
this.$store.state.lawSourceType = sourceType;
|
|
|
});
|
|
|
$(`#${str}_id a`)
|
|
|
.eq(1)
|
|
|
- .click(e => {
|
|
|
+ .click((e) => {
|
|
|
// 触发综合分析右侧面板点击事件
|
|
|
|
|
|
this.$bus.$emit("viewDetailsPopup", geojsonData);
|
|
@@ -301,7 +322,7 @@ export default {
|
|
|
}
|
|
|
// input添加点击事件
|
|
|
if ($(`#${str}_id input`)[1]) {
|
|
|
- $(`#${str}_id input`).click(e => {
|
|
|
+ $(`#${str}_id input`).click((e) => {
|
|
|
switch (e.target.defaultValue) {
|
|
|
case "取消":
|
|
|
this.cancelBtnEvent();
|
|
@@ -324,8 +345,8 @@ export default {
|
|
|
* @geoType -- 几何体类型
|
|
|
*/
|
|
|
createLabelDiv(str, coord, data, geoType) {
|
|
|
- console.log(str, coord, data, geoType, "createLabelDiv");
|
|
|
- console.log(str, "label - str");
|
|
|
+ // console.log(str, coord, data, geoType, "createLabelDiv");
|
|
|
+ // console.log(str, "label - str");
|
|
|
this.currentLabelHtml = this.$refs.labelRef.$el.innerHTML;
|
|
|
if (this.currentLabelHtml) {
|
|
|
let div = document.createElement("div");
|
|
@@ -337,7 +358,7 @@ export default {
|
|
|
console.log($(`#${str}_id textarea`).val(), "textarea");
|
|
|
$(`#${str}_id`).css("height", "100%");
|
|
|
|
|
|
- $(`#${str}_id input`).click(e => {
|
|
|
+ $(`#${str}_id input`).click((e) => {
|
|
|
console.log(e.target.defaultValue);
|
|
|
switch (e.target.defaultValue) {
|
|
|
case "取消":
|
|
@@ -366,20 +387,22 @@ export default {
|
|
|
// 修改人员名称
|
|
|
c_editor_name: localStorage.getItem("USER_NAME"),
|
|
|
// 修改人员ID
|
|
|
- c_editorid: localStorage.getItem("USER_ID")
|
|
|
+ c_editorid: localStorage.getItem("USER_ID"),
|
|
|
};
|
|
|
let modifyParams = new FormData();
|
|
|
modifyParams = {
|
|
|
columnId: 510,
|
|
|
modelId: 118,
|
|
|
- content: JSON.stringify(obj)
|
|
|
+ content: JSON.stringify(obj),
|
|
|
};
|
|
|
- this.$Post(this.urlsCollection.updateContent, modifyParams).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success("数据修改成功");
|
|
|
- map2DViewer.map.closePopup();
|
|
|
+ this.$Post(this.urlsCollection.updateContent, modifyParams).then(
|
|
|
+ (res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success("数据修改成功");
|
|
|
+ map2DViewer.map.closePopup();
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ );
|
|
|
},
|
|
|
cancelBtnEvent() {
|
|
|
map2DViewer.map.closePopup();
|
|
@@ -404,7 +427,13 @@ export default {
|
|
|
} else {
|
|
|
geoName = $(`#${str}_id input`).eq(0).val();
|
|
|
let coordinates = [data.points];
|
|
|
- let geometry = publicFun.generateGeoJSON(title, des, geoType, coordinates, geoName);
|
|
|
+ let geometry = publicFun.generateGeoJSON(
|
|
|
+ title,
|
|
|
+ des,
|
|
|
+ geoType,
|
|
|
+ coordinates,
|
|
|
+ geoName
|
|
|
+ );
|
|
|
let params = new FormData();
|
|
|
let newGeojson = JSON.stringify(geometry);
|
|
|
myLabelNameMap.set(geoName, newGeojson);
|
|
@@ -412,11 +441,11 @@ export default {
|
|
|
geojson: newGeojson,
|
|
|
type: geoType,
|
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
|
- sourceId: 0
|
|
|
+ sourceId: 0,
|
|
|
};
|
|
|
|
|
|
this.$Post(this.urlsCollection.addConllection, params).then(
|
|
|
- res => {
|
|
|
+ (res) => {
|
|
|
if (res.code == 200) {
|
|
|
// 标记成功后删除保存的原有名称
|
|
|
myLabelNameMap.delete(geoName);
|
|
@@ -426,33 +455,36 @@ export default {
|
|
|
paramData = {
|
|
|
userId: Number(localStorage.getItem("USER_ID")),
|
|
|
sourceId: 0,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
};
|
|
|
// 暂存map中刚刚保存的数据
|
|
|
- this.$Post(this.urlsCollection.selectByUser, paramData).then(userRes => {
|
|
|
- if (userRes.code === 200) {
|
|
|
- if (userRes.content.length > 0) {
|
|
|
- this.$store.state.myLabelPointsArr = [];
|
|
|
- this.$store.state.myLabelPointsArr = userRes.content.map(v => {
|
|
|
- if (JSON.stringify(geometry) === v.geojson) {
|
|
|
- sessionStorage.setItem("myLabelPointsId", v.id);
|
|
|
- }
|
|
|
- return {
|
|
|
- id: v.id,
|
|
|
- geojson: v.geojson,
|
|
|
- type: v.type
|
|
|
- };
|
|
|
- });
|
|
|
- // 判断刚刚暂存的数据,并调用小眼睛的方法
|
|
|
+ this.$Post(this.urlsCollection.selectByUser, paramData).then(
|
|
|
+ (userRes) => {
|
|
|
+ if (userRes.code === 200) {
|
|
|
+ if (userRes.content.length > 0) {
|
|
|
+ this.$store.state.myLabelPointsArr = [];
|
|
|
+ this.$store.state.myLabelPointsArr =
|
|
|
+ userRes.content.map((v) => {
|
|
|
+ if (JSON.stringify(geometry) === v.geojson) {
|
|
|
+ sessionStorage.setItem("myLabelPointsId", v.id);
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: v.id,
|
|
|
+ geojson: v.geojson,
|
|
|
+ type: v.type,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ // 判断刚刚暂存的数据,并调用小眼睛的方法
|
|
|
+ }
|
|
|
}
|
|
|
+ // 更新时调用一次搜索接口
|
|
|
}
|
|
|
- // 更新时调用一次搜索接口
|
|
|
- });
|
|
|
+ );
|
|
|
}
|
|
|
// 保存后需要删除地图上的标记
|
|
|
this.reStartLabelCase();
|
|
|
},
|
|
|
- error => {
|
|
|
+ (error) => {
|
|
|
console.log("标记疑点保存失败!", error);
|
|
|
this.reStartLabelCase();
|
|
|
}
|
|
@@ -466,7 +498,9 @@ export default {
|
|
|
map2DViewer.jlMap = L.tileLayer(
|
|
|
"http://t0.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=f331ba0b9ab96fb21c56d91de868935d"
|
|
|
).addTo(map2DViewer.map);
|
|
|
- map2DViewer.jlControl = L.control.sideBySide(map2DViewer.map, map2DViewer.jlMap).addTo(map2DViewer.map);
|
|
|
+ map2DViewer.jlControl = L.control
|
|
|
+ .sideBySide(map2DViewer.map, map2DViewer.jlMap)
|
|
|
+ .addTo(map2DViewer.map);
|
|
|
} else if (map2DViewer.map.hasLayer(map2DViewer.jlMap)) {
|
|
|
map2DViewer.map.removeControl(map2DViewer.jlControl);
|
|
|
map2DViewer.map.removeLayer(map2DViewer.jlMap);
|
|
@@ -489,7 +523,13 @@ export default {
|
|
|
// 每次点击按钮后重绘弹窗
|
|
|
if (this.currentHtml && this.currentCid) {
|
|
|
setTimeout(() => {
|
|
|
- this.popup.setContent(this.createAuditDiv(this.currentCid, this.currentProperties, this.currentSourceType));
|
|
|
+ this.popup.setContent(
|
|
|
+ this.createAuditDiv(
|
|
|
+ this.currentCid,
|
|
|
+ this.currentProperties,
|
|
|
+ this.currentSourceType
|
|
|
+ )
|
|
|
+ );
|
|
|
// .openOn(map2DViewer.map);
|
|
|
}, 300);
|
|
|
}
|
|
@@ -498,7 +538,7 @@ export default {
|
|
|
initDraw() {
|
|
|
if (!map2DViewer.measureTool) {
|
|
|
// 引入疑点标记绘制方法
|
|
|
- map2DViewer.drawToolFire = data => {
|
|
|
+ map2DViewer.drawToolFire = (data) => {
|
|
|
// 纬经度
|
|
|
if (data && data.points.length >= 1) {
|
|
|
let geoType = null;
|
|
@@ -537,7 +577,7 @@ export default {
|
|
|
color: "red",
|
|
|
font_size: "14px",
|
|
|
closeButton: true,
|
|
|
- iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png"
|
|
|
+ iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png",
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -548,11 +588,13 @@ export default {
|
|
|
"+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=krass +units=m +no_defs",
|
|
|
{
|
|
|
resolutions: [
|
|
|
- 132.2919312505292, 52.91677250021167, 26.458386250105836, 13.229193125052918, 5.291677250021167, 2.6458386250105836,
|
|
|
- 1.3229193125052918, 0.5291677250021167, 0.26458386250105836, 0.13229193125052918
|
|
|
+ 132.2919312505292, 52.91677250021167, 26.458386250105836,
|
|
|
+ 13.229193125052918, 5.291677250021167, 2.6458386250105836,
|
|
|
+ 1.3229193125052918, 0.5291677250021167, 0.26458386250105836,
|
|
|
+ 0.13229193125052918,
|
|
|
],
|
|
|
origin: [-66000, 75000],
|
|
|
- bounds: L.bounds([-65000, -76000], [75000, 72000])
|
|
|
+ bounds: L.bounds([-65000, -76000], [75000, 72000]),
|
|
|
}
|
|
|
);
|
|
|
|
|
@@ -562,7 +604,7 @@ export default {
|
|
|
minZoom: 1,
|
|
|
maxZoom: 6,
|
|
|
attributionControl: false,
|
|
|
- zoomControl: false
|
|
|
+ zoomControl: false,
|
|
|
// preferCanvas: true,
|
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
|
|
|
@@ -578,7 +620,7 @@ export default {
|
|
|
url: "http://aimap.pudong.sh:5236/zjmap/reproduction-service/maps/rest/services/sat-2019s4/proxy?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM",
|
|
|
// http://aimap.pudong.sh:5236/zjmap/reproduction-service/maps/rest/services/sat-2019s4/proxy?AccessKey=lUaEMxqqhZKLSImGuP/Ergx47orYVyIqHVgxfyGpIurKAy9kdq5uU1cWuTuIXeOM
|
|
|
// url: "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver",
|
|
|
- tileSize: 512
|
|
|
+ tileSize: 512,
|
|
|
// systemConfig.blueBlackMap,
|
|
|
})
|
|
|
.addTo(map2DViewer.map);
|
|
@@ -597,13 +639,19 @@ export default {
|
|
|
map2DViewer.groups["浦东新区_polygon"].remove();
|
|
|
}
|
|
|
// 请求并渲染新的区域图层
|
|
|
- get("./static/json/simplified_pdgeojson.json", "").then(geoJson => {
|
|
|
+ get("./static/json/simplified_pdgeojson.json", "").then((geoJson) => {
|
|
|
// 存放所有的面数据
|
|
|
map2DViewer.groups["浦东新区_polygon"] = L.featureGroup();
|
|
|
map2DViewer.groups["浦东新区_label"] = L.featureGroup();
|
|
|
map2DViewer.groups["浦东新区_polygon"].addTo(map2DViewer.map);
|
|
|
map2DViewer.groups["浦东新区_label"].addTo(map2DViewer.map);
|
|
|
- geoJson.features.map(feature => {
|
|
|
+ geoJson.features.map((feature) => {
|
|
|
+ let correctCordArr = JSON.parse(
|
|
|
+ JSON.stringify(feature.geometry.coordinates)
|
|
|
+ );
|
|
|
+ let newCorrectCoordArr = publicFun.latLngsCorrection(correctCordArr);
|
|
|
+ feature.geometry.coordinates = newCorrectCoordArr;
|
|
|
+
|
|
|
// if (
|
|
|
// this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
|
|
|
// ) {
|
|
@@ -618,12 +666,15 @@ export default {
|
|
|
w84Proj4ToShanghai(val) {
|
|
|
// 参数1:随意定义的坐标系名称,格式“EPSG:xxxxx”
|
|
|
// 参数2:prj文件里的内容
|
|
|
- this.$proj4.defs("EPSG:0986","+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=GRS80 +units=m +no_defs +type=crs");
|
|
|
- // "+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=krass +units=m +no_defs",
|
|
|
+ this.$proj4.defs(
|
|
|
+ "EPSG:0986",
|
|
|
+ "+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=GRS80 +units=m +no_defs +type=crs"
|
|
|
+ );
|
|
|
+ // "+proj=tmerc +lat_0=0 +lon_0=121.2751921 +k=1 +x_0=0 +y_0=-3457147.81 +ellps=krass +units=m +no_defs",
|
|
|
// 从"EPSG:0986"转成"EPSG:4326"
|
|
|
// coordinate 类型Array 例:[116, 39]
|
|
|
let pro = `PROJCS[\"shanghaicity\",GEOGCS[\"GCS_Beijing_1954\",DATUM[\"D_Beijing_1954\",SPHEROID[\"Krasovsky_1940\",6378245.0,298.3]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",-3457147.81],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",121.2751921],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]`;
|
|
|
- return this.$proj4( "EPSG:0986", "EPSG:4326",val);
|
|
|
+ return this.$proj4("EPSG:0986", "EPSG:4326", val);
|
|
|
},
|
|
|
// 可视化单一的镇域面
|
|
|
getSingleJsonData(name) {},
|
|
@@ -639,7 +690,10 @@ export default {
|
|
|
this.getJSonDataToStreet("", "");
|
|
|
// 切换到首页时需定位到当前图层
|
|
|
if (this.$store.state.homeSpecialTown === "全部") {
|
|
|
- this.setView(townLocationMap.get(this.$store.state.homeSpecialTown), 10);
|
|
|
+ this.setView(
|
|
|
+ townLocationMap.get(this.$store.state.homeSpecialTown),
|
|
|
+ 10
|
|
|
+ );
|
|
|
} else {
|
|
|
let polygon = townPolygonMap.get(this.$store.state.homeSpecialTown);
|
|
|
map2DViewer.map.fitBounds(polygon.getBounds());
|
|
@@ -654,8 +708,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
setView: function (coord, zoom) {
|
|
|
- // console.log(coord, "位置");
|
|
|
- let center = L.latLng(coord[0]-0.1915, coord[1]);
|
|
|
+ coord = publicFun.latLngsCorrection(coord);
|
|
|
+ let center = L.latLng(coord[0], coord[1]);
|
|
|
map2DViewer.map.setView(center, zoom);
|
|
|
},
|
|
|
renderPolygon: function (feature) {
|
|
@@ -671,14 +725,16 @@ export default {
|
|
|
weight: 3,
|
|
|
fillColor: this.getColor(name),
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4
|
|
|
+ fillOpacity: 0.4,
|
|
|
}).addTo(map2DViewer.groups["浦东新区_polygon"]);
|
|
|
|
|
|
center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
|
|
|
- center[0] -= 0.1915;
|
|
|
+ // center = publicFun.latLngsCorrection(center)
|
|
|
+ // 坐标偏移矫正
|
|
|
+ // center[0] -= 0.1915;
|
|
|
// center = coordinate.wgs84_to_shcj(center[0],center[1]);
|
|
|
// center = this.w84Proj4ToShanghai(center);
|
|
|
- console.log("center",center);
|
|
|
+ // console.log("center",center);
|
|
|
|
|
|
center.reverse();
|
|
|
// 坐标
|
|
@@ -688,31 +744,31 @@ export default {
|
|
|
radius: 10,
|
|
|
weight: 1,
|
|
|
fillOpacity: 0,
|
|
|
- color: "#e6d273"
|
|
|
+ color: "#e6d273",
|
|
|
});
|
|
|
wmarker.bindLabel(feature.properties.NAME, {
|
|
|
noHide: true,
|
|
|
clickable: true,
|
|
|
- offset: [-25, 10]
|
|
|
+ offset: [-25, 10],
|
|
|
});
|
|
|
wmarker.addTo(map2DViewer.groups["浦东新区_label"]);
|
|
|
let circle1 = L.circleMarker(center, {
|
|
|
radius: 8,
|
|
|
weight: 1,
|
|
|
fillOpacity: 0,
|
|
|
- color: "#e6d273"
|
|
|
+ color: "#e6d273",
|
|
|
}).addTo(map2DViewer.groups["浦东新区_polygon"]);
|
|
|
let circle2 = L.circleMarker(center, {
|
|
|
radius: 5,
|
|
|
weight: 1,
|
|
|
fillOpacity: 1,
|
|
|
- color: "#e6d273"
|
|
|
+ color: "#e6d273",
|
|
|
}).addTo(map2DViewer.groups["浦东新区_polygon"]);
|
|
|
},
|
|
|
latLngsToReverse: function (latlngsAry) {
|
|
|
var tempLatlngsAry = JSON.parse(JSON.stringify(latlngsAry));
|
|
|
if (typeof tempLatlngsAry[0] != "object") {
|
|
|
- tempLatlngsAry[0] -= 0.1915;
|
|
|
+ // tempLatlngsAry[0] -= 0.1915;
|
|
|
return tempLatlngsAry.reverse();
|
|
|
} else {
|
|
|
for (var i = 0, l = tempLatlngsAry.length; i < l; i++) {
|
|
@@ -744,30 +800,33 @@ export default {
|
|
|
addSinglePolygon(geometry, cid, color, uniqueId, mainType, sourceType) {
|
|
|
let uniqueIdList = [];
|
|
|
if (this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId]) {
|
|
|
- uniqueIdList = this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId];
|
|
|
+ uniqueIdList =
|
|
|
+ this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId];
|
|
|
}
|
|
|
|
|
|
let singlePolygonItem = {
|
|
|
uniqueId: uniqueId,
|
|
|
geometry: geometry,
|
|
|
- cid: cid
|
|
|
+ cid: cid,
|
|
|
};
|
|
|
uniqueIdList.push(singlePolygonItem);
|
|
|
- this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] = uniqueIdList;
|
|
|
+ this.$store.state.selectSelectDataMap["singlePolygon"][uniqueId] =
|
|
|
+ uniqueIdList;
|
|
|
// 当前数据坐标系为WGS84
|
|
|
let targetGeometry = JSON.parse(geometry).geometry;
|
|
|
// 预设模型与所有图层层级不同
|
|
|
let coord = targetGeometry.coordinates;
|
|
|
- let coordinates = publicFun.latLngsToReverse(coord);
|
|
|
+ let correctCoord = publicFun.latLngsCorrection(coord);
|
|
|
+ let coordinates = publicFun.latLngsToReverse(correctCoord);
|
|
|
let polygon = L.polygon(coordinates, {
|
|
|
color: color,
|
|
|
weight: 3,
|
|
|
fillColor: color,
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4
|
|
|
+ fillOpacity: 0.4,
|
|
|
}).addTo(map2DViewer.analysisGroups[uniqueId]);
|
|
|
|
|
|
- polygon.on("click", e => {
|
|
|
+ polygon.on("click", (e) => {
|
|
|
let geojsonData = geometry;
|
|
|
// 所有图层下的疑点图层 -- 常规展示
|
|
|
if (mainType === "所有图层") {
|
|
@@ -803,7 +862,7 @@ export default {
|
|
|
},
|
|
|
// 综合分析 - 图层绘制面
|
|
|
addPolygonLayer(data, cid, color) {
|
|
|
- data.map(feature => {
|
|
|
+ data.map((feature) => {
|
|
|
let polygonData = JSON.parse(JSON.stringify(feature));
|
|
|
let coordinates = polygonData.geometry.coordinates[0];
|
|
|
let infos = polygonData.properties;
|
|
@@ -812,16 +871,18 @@ export default {
|
|
|
weight: 3,
|
|
|
fillColor: color,
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4
|
|
|
+ fillOpacity: 0.4,
|
|
|
}).addTo(map2DViewer.map);
|
|
|
map2DViewer.polygons[`${cid}_layer`].push(polygon);
|
|
|
polygon.infos = infos;
|
|
|
- polygon.on("click", e => {
|
|
|
+ polygon.on("click", (e) => {
|
|
|
// console.log(e, "polygon");
|
|
|
this.auditPopupShow = true;
|
|
|
// console.log(e.latlng, "获取当前弹窗坐标111");
|
|
|
|
|
|
- this.popup = L.popup({ maxWidth: 700, maxHeight: 600 }).setLatLng(e.latlng).setContent(this.createAuditDiv(cid));
|
|
|
+ this.popup = L.popup({ maxWidth: 700, maxHeight: 600 })
|
|
|
+ .setLatLng(e.latlng)
|
|
|
+ .setContent(this.createAuditDiv(cid));
|
|
|
// .openOn(map2DViewer.map);
|
|
|
this.auditPopupShow = false;
|
|
|
this.popup.openOn(map2DViewer.map);
|
|
@@ -841,15 +902,16 @@ export default {
|
|
|
//综合分析 - 标记疑点 - 删除面
|
|
|
deletePolygonLayer(layer) {
|
|
|
console.log(layer, "layer");
|
|
|
- map2DViewer.polygons[layer].forEach(polygon => {
|
|
|
+ map2DViewer.polygons[layer].forEach((polygon) => {
|
|
|
map2DViewer.map.removeLayer(polygon);
|
|
|
});
|
|
|
},
|
|
|
|
|
|
drawPoints(data) {
|
|
|
if (!map2DViewer.myLabels[`label_${data.id}`]) {
|
|
|
+ data.coord = publicFun.latLngsCorrection(data.coord)
|
|
|
let point = L.marker(data.coord, {
|
|
|
- opacity: 1
|
|
|
+ opacity: 1,
|
|
|
}).addTo(map2DViewer.groups["我的标记图层组"]);
|
|
|
map2DViewer.myLabels[`label_${data.id}`] = point;
|
|
|
}
|
|
@@ -857,12 +919,13 @@ export default {
|
|
|
drawLine(data, color) {
|
|
|
if (!map2DViewer.myLabels[`label_${data.id}`]) {
|
|
|
let coordinates = JSON.parse(data.geojson).geometry.coordinates[0];
|
|
|
+ coordinates = publicFun.latLngsCorrection(coordinates)
|
|
|
let polyline = L.polyline(coordinates, {
|
|
|
color: color,
|
|
|
weight: 3,
|
|
|
fillOpacity: color,
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4
|
|
|
+ fillOpacity: 0.4,
|
|
|
}).addTo(map2DViewer.groups["我的标记图层组"]);
|
|
|
// zoom the map to the polyline
|
|
|
map2DViewer.myLabels[`label_${data.id}`] = polyline;
|
|
@@ -871,12 +934,13 @@ export default {
|
|
|
drawPolygon(data, color) {
|
|
|
if (!map2DViewer.myLabels[`label_${data.id}`]) {
|
|
|
let coordinates = JSON.parse(data.geojson).geometry.coordinates[0];
|
|
|
+ coordinates = publicFun.latLngsCorrection(coordinates)
|
|
|
let polygon = L.polygon(coordinates, {
|
|
|
color: color,
|
|
|
weight: 3,
|
|
|
fillOpacity: color,
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4
|
|
|
+ fillOpacity: 0.4,
|
|
|
}).addTo(map2DViewer.groups["我的标记图层组"]);
|
|
|
|
|
|
map2DViewer.myLabels[`label_${data.id}`] = polygon;
|
|
@@ -886,7 +950,7 @@ export default {
|
|
|
drawCircle(data, color) {
|
|
|
if (!map2DViewer.myLabels[`label_${data.id}`]) {
|
|
|
let coordinates = JSON.parse(data.geojson).geometry.coordinates[0];
|
|
|
-
|
|
|
+ coordinates = publicFun.latLngsCorrection(coordinates)
|
|
|
if ((coordinates.length = 2)) {
|
|
|
let from = turf.point(coordinates[0].reverse());
|
|
|
let to = turf.point(coordinates[1].reverse());
|
|
@@ -899,7 +963,7 @@ export default {
|
|
|
fillOpacity: color,
|
|
|
opacity: 1,
|
|
|
fillOpacity: 0.4,
|
|
|
- radius: Number(distance)
|
|
|
+ radius: Number(distance),
|
|
|
}).addTo(map2DViewer.groups["我的标记图层组"]);
|
|
|
map2DViewer.myLabels[`label_${data.id}`] = circle;
|
|
|
}
|
|
@@ -930,8 +994,8 @@ export default {
|
|
|
if (geometry) {
|
|
|
geometry.removeFrom(map2DViewer.map);
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|