|
@@ -33,9 +33,6 @@ export default {
|
|
|
this.$bus.$on("caseAuditEvent", () => {
|
|
|
this.caseAuditEvent();
|
|
|
});
|
|
|
- // this.$bus.$on("labelCaseEvent", () => {
|
|
|
- // this.labelCaseEvent();
|
|
|
- // });
|
|
|
|
|
|
//地图初始化
|
|
|
this.mapInit();
|
|
@@ -55,8 +52,6 @@ export default {
|
|
|
this.$bus.$off("JLControl");
|
|
|
// 疑点审计
|
|
|
this.$bus.$off("caseAuditEvent");
|
|
|
- // 标记疑点
|
|
|
- // this.$bus.$off("labelCaseEvent");
|
|
|
},
|
|
|
computed: {
|
|
|
// 获取标记疑点按钮的状态
|
|
@@ -167,12 +162,6 @@ export default {
|
|
|
}, 300);
|
|
|
}
|
|
|
},
|
|
|
- // 标记疑点
|
|
|
- labelCaseEvent() {
|
|
|
- // 开始绘制图形
|
|
|
- console.log("label case");
|
|
|
- // map2DViewer.setDrawTool({ action: "start" });
|
|
|
- },
|
|
|
// 初始化引入绘制工具
|
|
|
initDraw() {
|
|
|
// 引入疑点标记绘制方法
|
|
@@ -218,8 +207,8 @@ export default {
|
|
|
}).setView(systemConfig.mapViewer.center, systemConfig.mapViewer.zoom);
|
|
|
|
|
|
//添加默认图层
|
|
|
- var guid = publicFun.buildGuid("baseLayer");
|
|
|
- var layer = L.esri
|
|
|
+ let guid = publicFun.buildGuid("baseLayer");
|
|
|
+ let layer = L.esri
|
|
|
.tiledMapLayer({
|
|
|
url:
|
|
|
systemConfig.mapService +
|
|
@@ -229,8 +218,12 @@ export default {
|
|
|
// tileSize: 512
|
|
|
})
|
|
|
.addTo(map2DViewer.map);
|
|
|
- layer.guid = guid;
|
|
|
- map2DViewer.layers[guid] = layer;
|
|
|
+ // layer.setStyle({opacity:0,fillOpacity:0})
|
|
|
+ map2DViewer.layers["darkmap"] = layer;
|
|
|
+
|
|
|
+ // 加载天地图
|
|
|
+ let imageryLayer = L.tileLayer(systemConfig.imageryLayer);
|
|
|
+ map2DViewer.layers["imagery"] = imageryLayer;
|
|
|
},
|
|
|
// 读取浦东新区GeoJSON格式的区域数据
|
|
|
getJSonData() {
|
|
@@ -238,6 +231,11 @@ export default {
|
|
|
this.mapInit();
|
|
|
} else {
|
|
|
get("./static/json/pdgeojson.json", "").then((geoJson) => {
|
|
|
+ map2DViewer.groups["district_polygon"] = L.featureGroup();
|
|
|
+ map2DViewer.groups["district_label"] = L.featureGroup();
|
|
|
+ // console.log(map2DViewer.groups["district_polygon"], "district_polygon group");
|
|
|
+ map2DViewer.groups["district_polygon"].addTo(map2DViewer.map);
|
|
|
+ map2DViewer.groups["district_label"].addTo(map2DViewer.map);
|
|
|
geoJson.features.map((feature) => {
|
|
|
if (
|
|
|
this.town.indexOf(feature.properties.NAME.replace("镇", "")) > -1
|
|
@@ -246,6 +244,14 @@ export default {
|
|
|
this.renderPolygon(feature);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // map2DViewer.groups["district_label"].remove()
|
|
|
+ // map2DViewer.groups["district_label"].addTo(map2DViewer.map)
|
|
|
+
|
|
|
+ // map2DViewer.groups["district_polygon"].setStyle({
|
|
|
+ // opacity: 0,
|
|
|
+ // fillOpacity: 0,
|
|
|
+ // });
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -265,7 +271,7 @@ export default {
|
|
|
fillColor: this.getColor(itemvalue),
|
|
|
opacity: 1,
|
|
|
fillOpacity: 0.4,
|
|
|
- }).addTo(map2DViewer.map);
|
|
|
+ }).addTo(map2DViewer.groups["district_polygon"]);
|
|
|
center = JSON.parse(JSON.stringify(center)).geometry.coordinates;
|
|
|
center.reverse();
|
|
|
let wmarker = L.circleMarker(center, {
|
|
@@ -279,19 +285,19 @@ export default {
|
|
|
clickable: true,
|
|
|
offset: [-25, 10],
|
|
|
});
|
|
|
- wmarker.addTo(map2DViewer.map);
|
|
|
+ wmarker.addTo(map2DViewer.groups["district_label"]);
|
|
|
L.circleMarker(center, {
|
|
|
radius: 8,
|
|
|
weight: 1,
|
|
|
fillOpacity: 0,
|
|
|
color: "#e6d273",
|
|
|
- }).addTo(map2DViewer.map);
|
|
|
+ }).addTo(map2DViewer.groups["district_polygon"]);
|
|
|
L.circleMarker(center, {
|
|
|
radius: 5,
|
|
|
weight: 1,
|
|
|
fillOpacity: 1,
|
|
|
color: "#e6d273",
|
|
|
- }).addTo(map2DViewer.map);
|
|
|
+ }).addTo(map2DViewer.groups["district_polygon"]);
|
|
|
},
|
|
|
latLngsToReverse: function (latlngsAry) {
|
|
|
var tempLatlngsAry = JSON.parse(JSON.stringify(latlngsAry));
|