From 04dae190af26730e8e0dcfb7cb4ec066400422f3 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期一, 14 八月 2023 16:43:25 +0800 Subject: [PATCH] 生产环境加载高德地图显示空白修改 --- src/views/Tools/AddOnlineMap.vue | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/views/Tools/AddOnlineMap.vue b/src/views/Tools/AddOnlineMap.vue index ca1e7b9..7099322 100644 --- a/src/views/Tools/AddOnlineMap.vue +++ b/src/views/Tools/AddOnlineMap.vue @@ -200,10 +200,14 @@ }, { name: "鍦板舰", - image: require("../../assets/img/imageLayer/tdmap_label.jpg"), + image: require("../../assets/img/imageLayer/dixing.png"), urls: "http://{host}/LFData/2d/tiles/ter/{z}/{x}/{y}.png", }, - + { + name: "1:20涓囧尯鍩熷湴璐ㄥ浘", + image: require("../../assets/img/imageLayer/25dizhi.png"), + urls: "http://{host}/LFData/2d/tiles/20w_qydz/{z}/{x}/{y}.png", + }, ], } @@ -233,6 +237,7 @@ open() { this.close(true); this.$refs.pop.open(); + }, changeToken(token) { this.mapCollection.tokne = token; @@ -244,6 +249,11 @@ window.BaseMapLayer ); window.map.removeLayer(window.olBaseMapLayer); + if (!is_production) { + if (window.vectorLayer) { + window.map.removeLayer(window.vectorLayer); + } + } }, addImageLayer(map, mapCollection) { @@ -269,6 +279,7 @@ window.map.addLayer(window.olBaseMapLayer); return; } else if (mapCollection.sourceType === "tdmap") { + var tokne = mapCollection.tokne; //娣诲姞澶╁湴鍥惧奖鍍� @@ -279,6 +290,7 @@ format: "image/jpeg", tileMatrixSetID: "GoogleMapsCompatible", })) + window.olBaseMapLayer = new TileLayer({ title: "楂樺痉鍦板浘", source: new XYZ({ @@ -293,7 +305,7 @@ window.BaseMapLayer = Viewer.imageryLayers.addImageryProvider( new Cesium.UrlTemplateImageryProvider({ url: map.urls, - maximumLevel: 18, + maximumLevel: 22, }) ); @@ -328,16 +340,12 @@ window.map.addLayer(window.olBaseMapLayer); } Viewer.imageryLayers.lowerToBottom(window.BaseMapLayer);//灏嗗浘灞傜Щ鍒版渶搴曞眰 + Viewer.imageryLayers.raise(window.BaseMapLayer);//灏嗗浘灞傜Щ鍒版渶搴曞眰 - Viewer.imageryLayers.raise(window.BaseMapLayer);//灏嗗浘灞備笂绉讳竴灞� + if (is_production) { + Viewer.imageryLayers.raise(window.BaseMapLayer);//灏嗗浘灞備笂绉讳竴灞� + } }, - - - - - - - // 娣诲姞鏁版嵁 addData() { if (this.data.urls && this.data.sourceType) { -- Gitblit v1.9.3