From f7ab8838f095134c65d2628fe54a6fb8c5df146e Mon Sep 17 00:00:00 2001 From: 少年 <1392120328@qq.com> Date: 星期三, 07 二月 2024 16:52:38 +0800 Subject: [PATCH] 111 --- 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 046f495..8519f2e 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 ol.View({ - center: ol.proj.fromLonLat([4.606512, 2.621472]), +let view = new View({ + center: olProj.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 ol.layer.Tile({ - source: new ol.source.WMTS({ +let LwSource = new Tile({ + source: new 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 ol.tilegrid.WMTS({ + tileGrid: new WMTSTileGrid({ 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 ol.layer.Tile({ + this.tileLayer1 = new Tile({ source: this.mapList.find((e) => e.id == this.locaMap1).value, }); // this.tileLayer2 = new Tile({ @@ -90,7 +90,7 @@ }, methods: { initMap() { - new ol.Map({ + new Map({ target: "mapContainer", layers: [ this.tileLayer1, -- Gitblit v1.9.3