|
@@ -80,7 +80,7 @@ import parse from "wellknown";
|
|
|
import { getPcsj, listPcsjXQList } from "@/api/supervise/pcsj";
|
|
|
|
|
|
import "ol/ol.css";
|
|
|
-import { get as getProjection, transform } from "ol/proj.js";
|
|
|
+// import { get as getProjection, transform } from "ol/proj.js";
|
|
|
import Map from "ol/Map";
|
|
|
import View from "ol/View";
|
|
|
import TileLayer from "ol/layer/Tile";
|
|
@@ -104,6 +104,8 @@ import Draw from "ol/interaction/Draw";
|
|
|
import GeoJSON from "ol/format/GeoJSON";
|
|
|
import GeoTIFF from "ol/source/GeoTIFF";
|
|
|
import WebGLTile from "ol/layer/WebGLTile";
|
|
|
+import { transform } from "@/utils/transformUtils";
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
MapView,
|
|
@@ -144,7 +146,7 @@ export default {
|
|
|
methods: {
|
|
|
tableClick(row) {
|
|
|
let url = this.newObj.proxypath + row.hsxtif;
|
|
|
- this.$refs.MapView.createMap('split')
|
|
|
+ this.$refs.MapView.createMap("split");
|
|
|
console.log(row, "-----", url);
|
|
|
const source = new GeoTIFF({
|
|
|
sources: [
|
|
@@ -170,7 +172,7 @@ export default {
|
|
|
// projection: 'EPSG:4326'
|
|
|
// })
|
|
|
// });
|
|
|
- window.map.addLayer(layer);
|
|
|
+ window.map["mapDiv"].addLayer(layer);
|
|
|
},
|
|
|
getList() {
|
|
|
listPcsjXQList(this.queryParams).then((response) => {
|
|
@@ -193,14 +195,14 @@ export default {
|
|
|
addGeoJson() {
|
|
|
for (let i = 0; i < this.tableData.length; i++) {
|
|
|
if (this.tableData[i].geom && this.tableData[i].geom != "") {
|
|
|
- let geom = this.tableData[i].geom;
|
|
|
+ let geom = transform(this.tableData[i].geom);
|
|
|
this.tableData[i].geom = parse(geom);
|
|
|
let features = new GeoJSON().readFeatures(this.tableData[i].geom);
|
|
|
this.curPageResultLayer.getSource().addFeatures(features);
|
|
|
}
|
|
|
}
|
|
|
let fullExtent = this.curPageResultLayer.getSource().getExtent();
|
|
|
- window.map['mapDiv'].getView().fit(fullExtent, {
|
|
|
+ window.map["mapDiv"].getView().fit(fullExtent, {
|
|
|
duration: 3, //动画的持续时间,
|
|
|
callback: null,
|
|
|
});
|
|
@@ -222,7 +224,7 @@ export default {
|
|
|
}),
|
|
|
}),
|
|
|
});
|
|
|
- window.map['mapDiv'].addLayer(this.vectorLayer);
|
|
|
+ window.map["mapDiv"].addLayer(this.vectorLayer);
|
|
|
}
|
|
|
if (!this.curPageResultLayer) {
|
|
|
let vectorSource = new VectorSource();
|
|
@@ -236,7 +238,7 @@ export default {
|
|
|
}),
|
|
|
}),
|
|
|
});
|
|
|
- window.map['mapDiv'].addLayer(this.curPageResultLayer);
|
|
|
+ window.map["mapDiv"].addLayer(this.curPageResultLayer);
|
|
|
}
|
|
|
},
|
|
|
},
|