|
@@ -30,7 +30,7 @@ export default {
|
|
currentHtml: null,
|
|
currentHtml: null,
|
|
// 标记疑点
|
|
// 标记疑点
|
|
currentLabelCid: null,
|
|
currentLabelCid: null,
|
|
- currentLabelHtml: null,
|
|
|
|
|
|
+ currentLabelHtml: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -48,7 +48,7 @@ export default {
|
|
this.$store.state.mapMethodsCollection.set("RENDER", {
|
|
this.$store.state.mapMethodsCollection.set("RENDER", {
|
|
addPolygonLayer: this.addPolygonLayer,
|
|
addPolygonLayer: this.addPolygonLayer,
|
|
setView: this.setView,
|
|
setView: this.setView,
|
|
- deletePolygonLayer: this.deletePolygonLayer,
|
|
|
|
|
|
+ deletePolygonLayer: this.deletePolygonLayer
|
|
});
|
|
});
|
|
},
|
|
},
|
|
beforeDestroyed() {
|
|
beforeDestroyed() {
|
|
@@ -61,14 +61,14 @@ export default {
|
|
// 监听底部菜单栏的状态
|
|
// 监听底部菜单栏的状态
|
|
getLabelCaseBtnStatus() {
|
|
getLabelCaseBtnStatus() {
|
|
//疑点审计 1,0
|
|
//疑点审计 1,0
|
|
- let index = this.$store.state.bottomMenuIndexs.index;
|
|
|
|
- let subIndex = this.$store.state.bottomMenuIndexs.subIndex;
|
|
|
|
- return { index, subIndex };
|
|
|
|
|
|
+ let _index = this.$store.state.bottomMenuIndexs.index;
|
|
|
|
+ let _subIndex = this.$store.state.bottomMenuIndexs.subIndex;
|
|
|
|
+ return { index: _index, subIndex: _subIndex };
|
|
},
|
|
},
|
|
// 监听当前菜单
|
|
// 监听当前菜单
|
|
getCurrentMenu() {
|
|
getCurrentMenu() {
|
|
return this.$store.state.navSelect;
|
|
return this.$store.state.navSelect;
|
|
- },
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
getLabelCaseBtnStatus(val) {
|
|
getLabelCaseBtnStatus(val) {
|
|
@@ -81,11 +81,11 @@ export default {
|
|
this.stopLabelCase();
|
|
this.stopLabelCase();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getCurrentMenu: {
|
|
|
|
|
|
+ "$store.state.navSelect": {
|
|
handler(val) {
|
|
handler(val) {
|
|
console.log(val, "currentMenu -- test");
|
|
console.log(val, "currentMenu -- test");
|
|
if (val.index !== "3") {
|
|
if (val.index !== "3") {
|
|
- if(this.JLControlShowStatus){
|
|
|
|
|
|
+ if (this.JLControlShowStatus) {
|
|
this.JLControl();
|
|
this.JLControl();
|
|
}
|
|
}
|
|
this.stopLabelCase();
|
|
this.stopLabelCase();
|
|
@@ -97,8 +97,8 @@ export default {
|
|
this.getJSonData();
|
|
this.getJSonData();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- immediate: true,
|
|
|
|
- },
|
|
|
|
|
|
+ immediate: true
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 开始标记疑点事件
|
|
// 开始标记疑点事件
|
|
@@ -107,9 +107,13 @@ export default {
|
|
},
|
|
},
|
|
// 停止标记疑点事件
|
|
// 停止标记疑点事件
|
|
stopLabelCase() {
|
|
stopLabelCase() {
|
|
- map2DViewer.setDrawTool({
|
|
|
|
- action: "remove",
|
|
|
|
- });
|
|
|
|
|
|
+ try {
|
|
|
|
+ map2DViewer.setDrawTool({
|
|
|
|
+ action: "remove"
|
|
|
|
+ });
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log("MapHolder.vue 停止标记疑点事件 error");
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 常规图层弹窗
|
|
// 常规图层弹窗
|
|
createAuditDiv(str) {
|
|
createAuditDiv(str) {
|
|
@@ -130,14 +134,14 @@ export default {
|
|
$(() => {
|
|
$(() => {
|
|
// 法律法规点击事件
|
|
// 法律法规点击事件
|
|
if ($(`#${str}_id a`)) {
|
|
if ($(`#${str}_id a`)) {
|
|
- $(`#${str}_id a`).click((e) => {
|
|
|
|
|
|
+ $(`#${str}_id a`).click(e => {
|
|
console.log(e, "显示疑点相关的弹窗");
|
|
console.log(e, "显示疑点相关的弹窗");
|
|
this.$store.state.lawPopupShow = true;
|
|
this.$store.state.lawPopupShow = true;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
// input添加点击事件
|
|
// input添加点击事件
|
|
if ($(`#${str}_id input`)[1]) {
|
|
if ($(`#${str}_id input`)[1]) {
|
|
- $(`#${str}_id input`).click((e) => {
|
|
|
|
|
|
+ $(`#${str}_id input`).click(e => {
|
|
switch (e.target.defaultValue) {
|
|
switch (e.target.defaultValue) {
|
|
case "修改":
|
|
case "修改":
|
|
this.modifyBtnEvent();
|
|
this.modifyBtnEvent();
|
|
@@ -170,7 +174,7 @@ export default {
|
|
$(() => {
|
|
$(() => {
|
|
console.log($(`#${str}_id textarea`).val(), "textarea");
|
|
console.log($(`#${str}_id textarea`).val(), "textarea");
|
|
$(`#${str}_id`).css("height", "100%");
|
|
$(`#${str}_id`).css("height", "100%");
|
|
- $(`#${str}_id input`).click((e) => {
|
|
|
|
|
|
+ $(`#${str}_id input`).click(e => {
|
|
console.log(e.target.defaultValue);
|
|
console.log(e.target.defaultValue);
|
|
switch (e.target.defaultValue) {
|
|
switch (e.target.defaultValue) {
|
|
case "删除":
|
|
case "删除":
|
|
@@ -200,14 +204,16 @@ export default {
|
|
console.log("save btn");
|
|
console.log("save btn");
|
|
let type = $(`#${str}_id select`).val();
|
|
let type = $(`#${str}_id select`).val();
|
|
let des = $(`#${str}_id textarea`).val();
|
|
let des = $(`#${str}_id textarea`).val();
|
|
-
|
|
|
|
- this.$store.state.myLabelPointsArr.push({
|
|
|
|
|
|
+ let _oldMyLabelPointsArr = this.$store.state.myLabelPointsArr;
|
|
|
|
+ let _myLabelPointsArrMap = {
|
|
id: publicFun.buildGuid("myLabel"),
|
|
id: publicFun.buildGuid("myLabel"),
|
|
coord: coord,
|
|
coord: coord,
|
|
type: type,
|
|
type: type,
|
|
des: des,
|
|
des: des,
|
|
- data: data,
|
|
|
|
- });
|
|
|
|
|
|
+ data: data
|
|
|
|
+ };
|
|
|
|
+ _oldMyLabelPointsArr.push(_myLabelPointsArrMap);
|
|
|
|
+ this.$store.commit("changeMyLabelData", _oldMyLabelPointsArr);
|
|
map2DViewer.map.closePopup();
|
|
map2DViewer.map.closePopup();
|
|
},
|
|
},
|
|
// 卷帘对比
|
|
// 卷帘对比
|
|
@@ -217,9 +223,7 @@ export default {
|
|
map2DViewer.jlMap = L.tileLayer(
|
|
map2DViewer.jlMap = L.tileLayer(
|
|
"http://t0.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=f331ba0b9ab96fb21c56d91de868935d"
|
|
"http://t0.tianditu.gov.cn/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=f331ba0b9ab96fb21c56d91de868935d"
|
|
).addTo(map2DViewer.map);
|
|
).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 {
|
|
} else {
|
|
map2DViewer.map.removeControl(map2DViewer.jlControl);
|
|
map2DViewer.map.removeControl(map2DViewer.jlControl);
|
|
map2DViewer.map.removeLayer(map2DViewer.jlMap);
|
|
map2DViewer.map.removeLayer(map2DViewer.jlMap);
|
|
@@ -233,27 +237,31 @@ export default {
|
|
// 每次点击按钮后重绘弹窗
|
|
// 每次点击按钮后重绘弹窗
|
|
if (this.currentHtml && this.currentCid) {
|
|
if (this.currentHtml && this.currentCid) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- this.popup
|
|
|
|
- .setContent(this.createAuditDiv(this.currentCid))
|
|
|
|
- .openOn(map2DViewer.map);
|
|
|
|
|
|
+ this.popup.setContent(this.createAuditDiv(this.currentCid)).openOn(map2DViewer.map);
|
|
}, 300);
|
|
}, 300);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 初始化引入绘制工具
|
|
// 初始化引入绘制工具
|
|
initDraw() {
|
|
initDraw() {
|
|
// 引入疑点标记绘制方法
|
|
// 引入疑点标记绘制方法
|
|
- map2DViewer.drawToolFire = (data) => {
|
|
|
|
- // 纬经度
|
|
|
|
- if (data.points.length > 0) {
|
|
|
|
- console.log(data.points[data.points.length - 1], "绘制的图形");
|
|
|
|
- let coord = data.points[data.points.length - 1];
|
|
|
|
- let newCoord = { lat: coord[0], lng: coord[1] };
|
|
|
|
- this.labelDetailsPopupShow = true;
|
|
|
|
- this.labelPopup = L.popup({ maxWidth: 700, maxHeight: 600 })
|
|
|
|
- .setLatLng(newCoord)
|
|
|
|
- .setContent(this.createLabelDiv("label", coord, data))
|
|
|
|
- .openOn(map2DViewer.map);
|
|
|
|
- this.labelDetailsPopupShow = false;
|
|
|
|
|
|
+ map2DViewer.drawToolFire = data => {
|
|
|
|
+ try {
|
|
|
|
+ // 纬经度
|
|
|
|
+ if (data && data.points.length >= 1) {
|
|
|
|
+ console.log(data.points[data.points.length - 1], "绘制的图形");
|
|
|
|
+ let coord = data.points[data.points.length - 1];
|
|
|
|
+ if (coord && coord.length >= 2) {
|
|
|
|
+ let newCoord = { lat: coord[0], lng: coord[1] };
|
|
|
|
+ this.labelDetailsPopupShow = true;
|
|
|
|
+ this.labelPopup = L.popup({ maxWidth: 700, maxHeight: 600 })
|
|
|
|
+ .setLatLng(newCoord)
|
|
|
|
+ .setContent(this.createLabelDiv("label", coord, data))
|
|
|
|
+ .openOn(map2DViewer.map);
|
|
|
|
+ this.labelDetailsPopupShow = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log("引入疑点标记绘制方法 error");
|
|
}
|
|
}
|
|
};
|
|
};
|
|
map2DViewer.setDrawTool({
|
|
map2DViewer.setDrawTool({
|
|
@@ -263,7 +271,7 @@ export default {
|
|
color: "red",
|
|
color: "red",
|
|
font_size: "14px",
|
|
font_size: "14px",
|
|
closeButton: true,
|
|
closeButton: true,
|
|
- iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png",
|
|
|
|
|
|
+ iconUrl: "../../static/plugins/draw-plugin/images/marker-icon.png"
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -291,17 +299,14 @@ export default {
|
|
attributionControl: false,
|
|
attributionControl: false,
|
|
zoomControl: false,
|
|
zoomControl: false,
|
|
minZoom: 10,
|
|
minZoom: 10,
|
|
- maxZoom: 16,
|
|
|
|
|
|
+ maxZoom: 16
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
|
|
|
|
//添加默认图层
|
|
//添加默认图层
|
|
let guid = publicFun.buildGuid("baseLayer");
|
|
let guid = publicFun.buildGuid("baseLayer");
|
|
let layer = L.esri
|
|
let layer = L.esri
|
|
.tiledMapLayer({
|
|
.tiledMapLayer({
|
|
- url:
|
|
|
|
- systemConfig.mapService +
|
|
|
|
- "?servertype=Street_Purplish_Blue&token=" +
|
|
|
|
- systemConfig.token,
|
|
|
|
|
|
+ url: systemConfig.mapService + "?servertype=Street_Purplish_Blue&token=" + systemConfig.token
|
|
// url: "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver",
|
|
// url: "http://aimap.pudong.sh:5236/maps/rest/services/basemap-shanghai-gem-blue-sh2000/mapserver",
|
|
// tileSize: 512
|
|
// tileSize: 512
|
|
})
|
|
})
|
|
@@ -321,16 +326,14 @@ export default {
|
|
map2DViewer.groups["district_polygon"].remove();
|
|
map2DViewer.groups["district_polygon"].remove();
|
|
}
|
|
}
|
|
// 请求并渲染新的区域图层
|
|
// 请求并渲染新的区域图层
|
|
- get("./static/json/pdgeojson.json", "").then((geoJson) => {
|
|
|
|
|
|
+ get("./static/json/pdgeojson.json", "").then(geoJson => {
|
|
map2DViewer.groups["district_polygon"] = L.featureGroup();
|
|
map2DViewer.groups["district_polygon"] = L.featureGroup();
|
|
map2DViewer.groups["district_label"] = L.featureGroup();
|
|
map2DViewer.groups["district_label"] = L.featureGroup();
|
|
// console.log(map2DViewer.groups["district_polygon"], "district_polygon group");
|
|
// console.log(map2DViewer.groups["district_polygon"], "district_polygon group");
|
|
map2DViewer.groups["district_polygon"].addTo(map2DViewer.map);
|
|
map2DViewer.groups["district_polygon"].addTo(map2DViewer.map);
|
|
map2DViewer.groups["district_label"].addTo(map2DViewer.map);
|
|
map2DViewer.groups["district_label"].addTo(map2DViewer.map);
|
|
- geoJson.features.map((feature) => {
|
|
|
|
- if (
|
|
|
|
- this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
|
|
|
|
- ) {
|
|
|
|
|
|
+ geoJson.features.map(feature => {
|
|
|
|
+ if (this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1) {
|
|
let center = turf.center(feature.geometry);
|
|
let center = turf.center(feature.geometry);
|
|
this.renderPolygon(feature);
|
|
this.renderPolygon(feature);
|
|
}
|
|
}
|
|
@@ -370,7 +373,7 @@ export default {
|
|
weight: 3,
|
|
weight: 3,
|
|
fillColor: this.getColor(itemvalue),
|
|
fillColor: this.getColor(itemvalue),
|
|
opacity: 1,
|
|
opacity: 1,
|
|
- fillOpacity: 0.4,
|
|
|
|
|
|
+ fillOpacity: 0.4
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
|
|
center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
|
|
center.reverse();
|
|
center.reverse();
|
|
@@ -378,25 +381,25 @@ export default {
|
|
radius: 10,
|
|
radius: 10,
|
|
weight: 1,
|
|
weight: 1,
|
|
fillOpacity: 0,
|
|
fillOpacity: 0,
|
|
- color: "#e6d273",
|
|
|
|
|
|
+ color: "#e6d273"
|
|
});
|
|
});
|
|
wmarker.bindLabel(feature.properties.NAME, {
|
|
wmarker.bindLabel(feature.properties.NAME, {
|
|
noHide: true,
|
|
noHide: true,
|
|
clickable: true,
|
|
clickable: true,
|
|
- offset: [-25, 10],
|
|
|
|
|
|
+ offset: [-25, 10]
|
|
});
|
|
});
|
|
wmarker.addTo(map2DViewer.groups["district_label"]);
|
|
wmarker.addTo(map2DViewer.groups["district_label"]);
|
|
L.circleMarker(center, {
|
|
L.circleMarker(center, {
|
|
radius: 8,
|
|
radius: 8,
|
|
weight: 1,
|
|
weight: 1,
|
|
fillOpacity: 0,
|
|
fillOpacity: 0,
|
|
- color: "#e6d273",
|
|
|
|
|
|
+ color: "#e6d273"
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
L.circleMarker(center, {
|
|
L.circleMarker(center, {
|
|
radius: 5,
|
|
radius: 5,
|
|
weight: 1,
|
|
weight: 1,
|
|
fillOpacity: 1,
|
|
fillOpacity: 1,
|
|
- color: "#e6d273",
|
|
|
|
|
|
+ color: "#e6d273"
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
}).addTo(map2DViewer.groups["district_polygon"]);
|
|
},
|
|
},
|
|
latLngsToReverse: function (latlngsAry) {
|
|
latLngsToReverse: function (latlngsAry) {
|
|
@@ -424,7 +427,7 @@ export default {
|
|
addPolygonLayer(data, cid, color) {
|
|
addPolygonLayer(data, cid, color) {
|
|
// cid -- 'yongjiu'
|
|
// cid -- 'yongjiu'
|
|
// console.log(data, cid, color);
|
|
// console.log(data, cid, color);
|
|
- data.map((feature) => {
|
|
|
|
|
|
+ data.map(feature => {
|
|
let polygonData = JSON.parse(JSON.stringify(feature));
|
|
let polygonData = JSON.parse(JSON.stringify(feature));
|
|
let coordinates = polygonData.geometry.coordinates[0];
|
|
let coordinates = polygonData.geometry.coordinates[0];
|
|
let infos = polygonData.properties;
|
|
let infos = polygonData.properties;
|
|
@@ -433,18 +436,16 @@ export default {
|
|
weight: 3,
|
|
weight: 3,
|
|
fillColor: color,
|
|
fillColor: color,
|
|
opacity: 1,
|
|
opacity: 1,
|
|
- fillOpacity: 0.4,
|
|
|
|
|
|
+ fillOpacity: 0.4
|
|
}).addTo(map2DViewer.map);
|
|
}).addTo(map2DViewer.map);
|
|
map2DViewer.polygons[`${cid}_layer`].push(polygon);
|
|
map2DViewer.polygons[`${cid}_layer`].push(polygon);
|
|
polygon.infos = infos;
|
|
polygon.infos = infos;
|
|
- polygon.on("click", (e) => {
|
|
|
|
|
|
+ polygon.on("click", e => {
|
|
// console.log(e, "polygon");
|
|
// console.log(e, "polygon");
|
|
this.auditPopupShow = true;
|
|
this.auditPopupShow = true;
|
|
console.log(e.latlng, "获取当前弹窗坐标111");
|
|
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);
|
|
// .openOn(map2DViewer.map);
|
|
this.auditPopupShow = false;
|
|
this.auditPopupShow = false;
|
|
this.popup.openOn(map2DViewer.map);
|
|
this.popup.openOn(map2DViewer.map);
|
|
@@ -455,11 +456,11 @@ export default {
|
|
|
|
|
|
//综合分析 - 标记疑点 - 删除面
|
|
//综合分析 - 标记疑点 - 删除面
|
|
deletePolygonLayer(layer) {
|
|
deletePolygonLayer(layer) {
|
|
- map2DViewer.polygons[layer].forEach((polygon) => {
|
|
|
|
|
|
+ map2DViewer.polygons[layer].forEach(polygon => {
|
|
map2DViewer.map.removeLayer(polygon);
|
|
map2DViewer.map.removeLayer(polygon);
|
|
});
|
|
});
|
|
- },
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
<style scoped>
|
|
<style scoped>
|