From 36d70ba5cf8508509ad8a57e4bf53bf955fddcbf Mon Sep 17 00:00:00 2001
From: ZhAkps <46207005+ZhAkps@users.noreply.github.com>
Date: 星期二, 06 二月 2024 15:50:59 +0800
Subject: [PATCH] 更改引用方式

---
 src/components/poplayer/history.vue |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/components/poplayer/history.vue b/src/components/poplayer/history.vue
index 8519f2e..046f495 100644
--- a/src/components/poplayer/history.vue
+++ b/src/components/poplayer/history.vue
@@ -23,15 +23,15 @@
 
 <script>
 import mapType from "@/utils/maptype";
-import { Map, View } from "ol";
-import Tile from "ol/layer/Tile";
-import WMTS from "ol/source/WMTS";
-import WMTSTileGrid from "ol/tilegrid/WMTS";
-import * as olProj from "ol/proj";
-import XYZ from "ol/source/XYZ";
+// import { Map, View } from "ol";
+// import Tile from "ol/layer/Tile";
+// import WMTS from "ol/source/WMTS";
+// import WMTSTileGrid from "ol/tilegrid/WMTS";
+// import * as olProj from "ol/proj";
+// import XYZ from "ol/source/XYZ";
 
-let view = new View({
-  center: olProj.fromLonLat([4.606512, 2.621472]),
+let view = new ol.View({
+  center: ol.proj.fromLonLat([4.606512, 2.621472]),
   zoom: 13,
   enableRotation: false,
 });
@@ -43,14 +43,14 @@
   resolutions.push(topResolution / Math.pow(2, zoom));
   matrixIds[zoom] = zoom;
 }
-let LwSource = new Tile({
-  source: new WMTS({
+let LwSource = new ol.layer.Tile({
+  source: new ol.source.WMTS({
     url: "https://skyzt.bda.gov.cn/service/ImageEngine/picdis/abc?user=jjjskfq&password=Jjjskfq@2022",
     layer: "Shiliang_Lw_2019",
     style: "",
     format: "image/png",
     // 鎶曞奖鍧愭爣绯�
-    tileGrid: new WMTSTileGrid({
+    tileGrid: new ol.tilegrid.WMTS({
       extent: [371987.18334, 252920.58593, 624459.12036, 423400.07714],
       origin: [0, 688194],
       resolutions: resolutions,
@@ -80,7 +80,7 @@
   },
   mounted() {
     this.mapList = mapType;
-    this.tileLayer1 = new Tile({
+    this.tileLayer1 = new ol.layer.Tile({
       source: this.mapList.find((e) => e.id == this.locaMap1).value,
     });
     // this.tileLayer2 = new Tile({
@@ -90,7 +90,7 @@
   },
   methods: {
     initMap() {
-      new Map({
+      new ol.Map({
         target: "mapContainer",
         layers: [
           this.tileLayer1,

--
Gitblit v1.9.3