From c6df06bd690486739067ee1ee7124ac66da720fb Mon Sep 17 00:00:00 2001 From: 少年 <1392120328@qq.com> Date: 星期二, 27 二月 2024 14:23:32 +0800 Subject: [PATCH] youhua --- src/components/viewer2.vue | 71 +++++++++++++++++++++++++++++++++-- 1 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/components/viewer2.vue b/src/components/viewer2.vue index 534a607..84d5020 100644 --- a/src/components/viewer2.vue +++ b/src/components/viewer2.vue @@ -57,7 +57,7 @@ </template> <script> import store from "@/utils/store2.js"; -import { setClick,leftClick } from '@/utils/map2.js' +import { setClick, leftClick } from '@/utils/map2.js' import _GLOBAL from "@/assets/GLOBAL2"; // import { leftClick, loadLayer } from "@/utils/map.js"; import leftBottom from "@/components/leftMenu/bottom2.vue"; @@ -114,7 +114,7 @@ "my-history": history, "my-land-admin-info": landAdminInfo, "my-slider": sliderAlpha, - "my-poplayer":mainPoplayer + "my-poplayer": mainPoplayer }, data() { return { @@ -235,13 +235,13 @@ id: "cva_c", source: wmtsSource2, }); - wmtsLayer2.setVisible(false); + // wmtsLayer2.setVisible(false); ////鍗槦褰卞儚 layers.push(wmtsLayer); ////浜岀淮鍦板浘 layers.push(wmtsLayer2); ////璺綉 - layers.push(wmtsLayer1); + // layers.push(wmtsLayer1); const map = new ol.Map({ layers: layers, @@ -250,10 +250,72 @@ center: [116.505348, 39.795592], projection: "EPSG:4326", zoom: 12, + minZoom: 8.5 }), }); window.mapapi = map; + + //鍔犺浇鑸媿褰卞儚 + window.ImageLayer = new ol.layer.Tile({ + id: 'C0698021', + visible: true, + source: new ol.source.XYZ({ + wrapX: true, + url: `${'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'}/tile/{z}/{y}/{x}`, + }), + projection: new ol.proj.get('EPSG:4326') + }); + window.mapapi.addLayer(window.ImageLayer); + + //鍔犺浇楂樺痉鏍囨敞 + window.annotation = new ol.layer.Tile({ + id: '69EB42A8', + visible: true, + source: new ol.source.XYZ({ + wrapX: true, + url: `https://webst02.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}`, + }), + projection: new ol.proj.get('EPSG:4326') + }); + window.mapapi.addLayer(window.annotation); + + + window.hexin = new ol.layer.Tile({ + source: new ol.source.TileWMS({ + ratio: 3, + url: 'https://skyzt.bda.gov.cn/gisserver/wmsserver/YZ_BJ60',//鍥惧眰鍦板潃 + params: { + 'VERSION': '1.1.1', + 'SRS': 'EPSG:4326', + 'FORMAT': 'image/png', + 'TILED': true, + "LAYERS": '' + } + }) + }) + window.mapapi.addLayer(window.hexin) + + + //浜﹀簞鏂板煄瑙勫垝鑼冨洿 + window.yizhuang = new ol.layer.Tile({ + source: new ol.source.TileWMS({ + ratio: 3, + url: 'https://skyzt.bda.gov.cn/gisserver/wmsserver/YZ_BJ',//鍥惧眰鍦板潃 + params: { + 'VERSION': '1.1.1', + 'SRS': 'EPSG:4326', + 'FORMAT': 'image/png', + 'TILED': true, + "LAYERS": '' + } + }) + }) + window.mapapi.addLayer(window.yizhuang) + + + + setClick(true) // leftClick() // var url = @@ -447,5 +509,4 @@ .colseBtn img { width: 30px; } - </style> -- Gitblit v1.9.3