|
@@ -17,6 +17,7 @@ export default {
|
|
|
components: { CaseAuditPopup, LabelCasePopup },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 卷帘对比开关
|
|
|
JLControlShowStatus: false,
|
|
|
town: "祝桥镇,南汇新城镇,川沙新镇,老港镇,惠南镇,航头镇,泥城镇,书院镇,新场镇,大团镇,唐镇,曹路镇,宣桥镇,张江镇,合庆镇,周浦镇,康桥镇,三林镇,高桥镇,高东镇,金桥镇,北蔡镇,万祥镇,高行镇",
|
|
|
auditPopupShow: false,
|
|
@@ -44,13 +45,12 @@ export default {
|
|
|
this.mapInit();
|
|
|
// 可视化区域图
|
|
|
this.getJSonData();
|
|
|
-
|
|
|
// 地图常用渲染方法
|
|
|
// console.log(this.$store.state.mapMethodsCollection,"methods");
|
|
|
this.$store.state.mapMethodsCollection.set("RENDER", {
|
|
|
addPolygonLayer: this.addPolygonLayer,
|
|
|
setView: this.setView,
|
|
|
- deletePolygonLayer: this.deletePolygonLayer,
|
|
|
+ deletePolygonLayer: this.deletePolygonLayer
|
|
|
});
|
|
|
},
|
|
|
beforeDestroyed() {
|
|
@@ -76,13 +76,13 @@ export default {
|
|
|
$(() => {
|
|
|
// 法律法规点击事件
|
|
|
if ($(`#${str}_id a`)) {
|
|
|
- $(`#${str}_id a`).click((e) => {
|
|
|
+ $(`#${str}_id a`).click(e => {
|
|
|
console.log(e, "a label");
|
|
|
});
|
|
|
}
|
|
|
// input添加点击事件
|
|
|
if ($(`#${str}_id input`)[1]) {
|
|
|
- $(`#${str}_id input`).click((e) => {
|
|
|
+ $(`#${str}_id input`).click(e => {
|
|
|
switch (e.target.defaultValue) {
|
|
|
case "修改":
|
|
|
this.modifyBtnEvent();
|
|
@@ -106,7 +106,18 @@ export default {
|
|
|
|
|
|
// 卷帘对比
|
|
|
JLControl() {
|
|
|
- console.log("用户点击了卷帘对比菜单!");
|
|
|
+ this.JLControlShowStatus = !this.JLControlShowStatus;
|
|
|
+ if (this.JLControlShowStatus) {
|
|
|
+ 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);
|
|
|
+ } else {
|
|
|
+ map2DViewer.map.removeControl(map2DViewer.jlControl);
|
|
|
+ map2DViewer.map.removeLayer(map2DViewer.jlMap);
|
|
|
+ delete map2DViewer.jlMap;
|
|
|
+ map2DViewer.jlControl = null;
|
|
|
+ }
|
|
|
},
|
|
|
// 疑点审计
|
|
|
caseAuditEvent() {
|
|
@@ -131,7 +142,7 @@ export default {
|
|
|
attributionControl: false,
|
|
|
zoomControl: false,
|
|
|
minZoom: 10,
|
|
|
- maxZoom: 17,
|
|
|
+ maxZoom: 17
|
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
|
|
|
|
//添加默认图层
|
|
@@ -140,9 +151,7 @@ export default {
|
|
|
.tiledMapLayer({
|
|
|
url:
|
|
|
// "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver/"
|
|
|
- systemConfig.mapService +
|
|
|
- "?servertype=Street_Purplish_Blue&token=" +
|
|
|
- systemConfig.token,
|
|
|
+ systemConfig.mapService + "?servertype=Street_Purplish_Blue&token=" + systemConfig.token
|
|
|
})
|
|
|
.addTo(map2DViewer.map);
|
|
|
layer.guid = guid;
|
|
@@ -153,11 +162,9 @@ export default {
|
|
|
if (!map2DViewer.map) {
|
|
|
this.mapInit();
|
|
|
} else {
|
|
|
- get("./static/json/pdgeojson.json", "").then((geoJson) => {
|
|
|
- geoJson.features.map((feature) => {
|
|
|
- if (
|
|
|
- this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
|
|
|
- ) {
|
|
|
+ get("./static/json/pdgeojson.json", "").then(geoJson => {
|
|
|
+ geoJson.features.map(feature => {
|
|
|
+ if (this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1) {
|
|
|
let center = turf.center(feature.geometry);
|
|
|
this.renderPolygon(feature);
|
|
|
}
|
|
@@ -180,7 +187,7 @@ export default {
|
|
|
weight: 3,
|
|
|
fillColor: this.getColor(itemvalue),
|
|
|
opacity: 1,
|
|
|
- fillOpacity: 0.4,
|
|
|
+ fillOpacity: 0.4
|
|
|
}).addTo(map2DViewer.map);
|
|
|
center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
|
|
|
center.reverse();
|
|
@@ -188,25 +195,25 @@ 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.map);
|
|
|
L.circleMarker(center, {
|
|
|
radius: 8,
|
|
|
weight: 1,
|
|
|
fillOpacity: 0,
|
|
|
- color: "#e6d273",
|
|
|
+ color: "#e6d273"
|
|
|
}).addTo(map2DViewer.map);
|
|
|
L.circleMarker(center, {
|
|
|
radius: 5,
|
|
|
weight: 1,
|
|
|
fillOpacity: 1,
|
|
|
- color: "#e6d273",
|
|
|
+ color: "#e6d273"
|
|
|
}).addTo(map2DViewer.map);
|
|
|
},
|
|
|
latLngsToReverse: function (latlngsAry) {
|
|
@@ -234,7 +241,7 @@ export default {
|
|
|
addPolygonLayer(data, cid, color) {
|
|
|
// cid -- 'yongjiu'
|
|
|
console.log(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;
|
|
@@ -243,7 +250,7 @@ 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;
|
|
@@ -265,11 +272,11 @@ export default {
|
|
|
|
|
|
//综合分析 - 标记疑点 - 删除面
|
|
|
deletePolygonLayer(layer) {
|
|
|
- map2DViewer.polygons[layer].forEach((polygon) => {
|
|
|
+ map2DViewer.polygons[layer].forEach(polygon => {
|
|
|
map2DViewer.map.removeLayer(polygon);
|
|
|
});
|
|
|
- },
|
|
|
- },
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|