|
@@ -1,9 +1,5 @@
|
|
|
<template>
|
|
|
<div id="map2DViewer">
|
|
|
- <!-- <LabelCasePopup
|
|
|
- v-show="true"
|
|
|
- style="position: fixed; left: 40%; top: 30%; z-index: 99999"
|
|
|
- /> -->
|
|
|
<CaseAuditPopup v-show="auditPopupShow" ref="auditPopup" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -50,7 +46,7 @@ export default {
|
|
|
this.$store.state.mapMethodsCollection.set("RENDER", {
|
|
|
addPolygonLayer: this.addPolygonLayer,
|
|
|
setView: this.setView,
|
|
|
- deletePolygonLayer: this.deletePolygonLayer
|
|
|
+ deletePolygonLayer: this.deletePolygonLayer,
|
|
|
});
|
|
|
},
|
|
|
beforeDestroyed() {
|
|
@@ -76,13 +72,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();
|
|
@@ -111,7 +107,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 {
|
|
|
map2DViewer.map.removeControl(map2DViewer.jlControl);
|
|
|
map2DViewer.map.removeLayer(map2DViewer.jlMap);
|
|
@@ -142,7 +140,7 @@ export default {
|
|
|
attributionControl: false,
|
|
|
zoomControl: false,
|
|
|
minZoom: 10,
|
|
|
- maxZoom: 16
|
|
|
+ maxZoom: 16,
|
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
|
|
|
|
//添加默认图层
|
|
@@ -151,7 +149,9 @@ 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;
|
|
@@ -162,9 +162,11 @@ 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);
|
|
|
}
|
|
@@ -187,7 +189,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();
|
|
@@ -195,25 +197,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) {
|
|
@@ -241,7 +243,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;
|
|
@@ -250,7 +252,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;
|
|
@@ -272,11 +274,11 @@ export default {
|
|
|
|
|
|
//综合分析 - 标记疑点 - 删除面
|
|
|
deletePolygonLayer(layer) {
|
|
|
- map2DViewer.polygons[layer].forEach(polygon => {
|
|
|
+ map2DViewer.polygons[layer].forEach((polygon) => {
|
|
|
map2DViewer.map.removeLayer(polygon);
|
|
|
});
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped>
|