|
@@ -131,6 +131,7 @@ export default {
|
|
curPageResultLayer: {},
|
|
curPageResultLayer: {},
|
|
vectorLayer: {},
|
|
vectorLayer: {},
|
|
nowId: "",
|
|
nowId: "",
|
|
|
|
+ itemObj: {}, //用于存储分屏高亮的实体
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -155,6 +156,7 @@ export default {
|
|
this.nowId = row.id;
|
|
this.nowId = row.id;
|
|
addTiff("mapCon1", urlQsx);
|
|
addTiff("mapCon1", urlQsx);
|
|
addTiff("mapCon2", urlHsx);
|
|
addTiff("mapCon2", urlHsx);
|
|
|
|
+ this.test(row);
|
|
} else {
|
|
} else {
|
|
this.maptype = "normal";
|
|
this.maptype = "normal";
|
|
this.nowId = "";
|
|
this.nowId = "";
|
|
@@ -181,7 +183,44 @@ export default {
|
|
handleClose() {
|
|
handleClose() {
|
|
this.drawer = false;
|
|
this.drawer = false;
|
|
},
|
|
},
|
|
- test() {},
|
|
|
|
|
|
+ test(item) {
|
|
|
|
+ window.map["mapCon1"].removeLayer(this.itemObj);
|
|
|
|
+ window.map["mapCon2"].removeLayer(this.itemObj);
|
|
|
|
+
|
|
|
|
+ if (item.geom && item.geom != "") {
|
|
|
|
+ if (typeof item.geom === "string") {
|
|
|
|
+ let geom = this.tableData[i].geom;
|
|
|
|
+ item.geom = parse(geom);
|
|
|
|
+ }
|
|
|
|
+ let features = new GeoJSON().readFeatures(item.geom);
|
|
|
|
+ this.itemObj = new VectorLayer({
|
|
|
|
+ source: new VectorSource({
|
|
|
|
+ features: features,
|
|
|
|
+ }),
|
|
|
|
+ style: function (feature) {
|
|
|
|
+ return new Style({
|
|
|
|
+ fill: new Fill({
|
|
|
|
+ //矢量图层填充颜色,以及透明度
|
|
|
|
+ color: "#f006",
|
|
|
|
+ }),
|
|
|
|
+ stroke: new Stroke({
|
|
|
|
+ //边界样式
|
|
|
|
+ color: "rgba(255, 0, 0, 1)",
|
|
|
|
+ width: 2,
|
|
|
|
+ }),
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ zIndex: 9999,
|
|
|
|
+ });
|
|
|
|
+ let fullExtent = this.itemObj.getSource().getExtent();
|
|
|
|
+ window.map["mapCon1"].getView().fit(fullExtent, {
|
|
|
|
+ duration: 3, //动画的持续时间,
|
|
|
|
+ callback: null,
|
|
|
|
+ });
|
|
|
|
+ window.map["mapCon1"].addLayer(this.itemObj);
|
|
|
|
+ window.map["mapCon2"].addLayer(this.itemObj);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
|
|
addGeoJson(name) {
|
|
addGeoJson(name) {
|
|
this.tableData.forEach((titem, i) => {
|
|
this.tableData.forEach((titem, i) => {
|
|
@@ -224,7 +263,7 @@ export default {
|
|
let vectorSource = new VectorSource();
|
|
let vectorSource = new VectorSource();
|
|
this.curPageResultLayer[name] = new VectorLayer({
|
|
this.curPageResultLayer[name] = new VectorLayer({
|
|
source: vectorSource,
|
|
source: vectorSource,
|
|
- zIndex: 99999,
|
|
|
|
|
|
+ zIndex: 999,
|
|
style: new Style({
|
|
style: new Style({
|
|
stroke: new Stroke({
|
|
stroke: new Stroke({
|
|
color: "#1f1cd3",
|
|
color: "#1f1cd3",
|