|
@@ -102,9 +102,8 @@ import ImageLayer from "ol/layer/Image";
|
|
|
import ImageStatic from "ol/source/ImageStatic";
|
|
|
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";
|
|
|
+import { removeWebGLTile, addTiff } from "@/utils/help";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -147,46 +146,21 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
tableClick(row) {
|
|
|
- this.removeWebGLTile("mapCon1");
|
|
|
- this.removeWebGLTile("mapCon2");
|
|
|
+ removeWebGLTile("mapCon1");
|
|
|
+ removeWebGLTile("mapCon2");
|
|
|
let urlQsx = this.newObj.proxypath + row.qsxtif;
|
|
|
let urlHsx = this.newObj.proxypath + row.hsxtif;
|
|
|
if (this.nowId != row.id) {
|
|
|
this.maptype = "split";
|
|
|
this.nowId = row.id;
|
|
|
- this.addLayer("mapCon1", urlQsx);
|
|
|
- this.addLayer("mapCon2", urlHsx);
|
|
|
+ addTiff("mapCon1", urlQsx);
|
|
|
+ addTiff("mapCon2", urlHsx);
|
|
|
} else {
|
|
|
this.maptype = "normal";
|
|
|
this.nowId = "";
|
|
|
}
|
|
|
},
|
|
|
- removeWebGLTile(name) {
|
|
|
- console.log(name);
|
|
|
- const allLayers = window.map[name].getLayers().getArray();
|
|
|
- allLayers.forEach((layer) => {
|
|
|
- if (layer instanceof WebGLTile) {
|
|
|
- window.map[name].removeLayer(layer);
|
|
|
- }
|
|
|
- });
|
|
|
- console.log(window.map[name].getLayers().getArray(), name);
|
|
|
- },
|
|
|
- addLayer(name, url) {
|
|
|
- const source = new GeoTIFF({
|
|
|
- sources: [
|
|
|
- {
|
|
|
- url,
|
|
|
- nodata: 0,
|
|
|
- imageExtent: [38.207187, 106.672957, 38.21268, 106.67845],
|
|
|
- projection: "EPSG:4326",
|
|
|
- },
|
|
|
- ],
|
|
|
- });
|
|
|
- const layer = new WebGLTile({
|
|
|
- source: source,
|
|
|
- });
|
|
|
- window.map[name].addLayer(layer);
|
|
|
- },
|
|
|
+
|
|
|
getList() {
|
|
|
listPcsjXQList(this.queryParams).then((response) => {
|
|
|
this.tableData = response.rows;
|