From 12075d0fa73d963ff5d6dbc4727fb95fb6084961 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期五, 01 三月 2024 09:32:40 +0800 Subject: [PATCH] 代码更新 --- src/assets/js/Map/server.js | 2 public/WebSDK/Workers/image/location.png | 0 public/WebSDK/Workers/path/Path.html | 4 +- public/config/config.js | 16 ++++---- src/assets/js/Map/menuTool.js | 15 ++++++- src/assets/js/Map/olMap.js | 26 ++++++------- src/views/layer/layerManage.vue | 1 7 files changed, 36 insertions(+), 28 deletions(-) diff --git a/public/WebSDK/Workers/image/location.png b/public/WebSDK/Workers/image/location.png new file mode 100644 index 0000000..ad1941b --- /dev/null +++ b/public/WebSDK/Workers/image/location.png Binary files differ diff --git a/public/WebSDK/Workers/path/Path.html b/public/WebSDK/Workers/path/Path.html index 1ca92c8..6efd8a8 100644 --- a/public/WebSDK/Workers/path/Path.html +++ b/public/WebSDK/Workers/path/Path.html @@ -138,8 +138,8 @@ <div class="layui-input-block"> <select id="sjms" name="sjms" lay-filter="sjms"> <option value="0">璺熼殢妯″瀷</option> - <option value="1">绗竴浜虹О瑙嗚</option> - <option value="2">涓婂笣瑙嗚</option> + <!-- <option value="1">绗竴浜虹О瑙嗚</option> --> + <!-- <option value="2">涓婂笣瑙嗚</option> --> </select> </div> </div> diff --git a/public/config/config.js b/public/config/config.js index 1287d4d..cb4a750 100644 --- a/public/config/config.js +++ b/public/config/config.js @@ -1,19 +1,18 @@ -//鏄惁涓虹敓浜х幆澧� -var isWeb = location.hostname.indexOf("103.85.165.") > -1; +锘�//鏄惁涓虹敓浜х幆澧� +var isWeb = location.hostname.indexOf("172.") > -1; //鏄惁涓虹敓浜х幆澧� const webUrl = location.href.indexOf("/web") > -1 ? "/web" : ""; -// var webHost = isWeb ? "103.85.165.99" + ":28888" : '106.120.22.35' + ":28888"; -var webHost = isWeb ? "103.85.165.99" + ":28888" : '192.168.20.83' + ":8888"; -// var webHost = isWeb ? "103.85.165.99" + ":28888" : '100.10.1.169' + ":8088"; -var imageUrl = "http://localhost:8080"+webUrl +var webHost = isWeb ? "172.16.2.10" + ":10088" : '100.10.1.169' + ":8088"; + +var webArcgis = isWeb? "172.16.2.10" + ":26081" : '100.10.1.169' + ":6080" // WebSocket 鏈嶅姟鍦板潃 var socketUrl = 'ws://' + webHost + '/MoonServer/ws/select'; //閰嶇疆鏂囦欢鍦板潃 const config = { mapMoon: webUrl + "/mapscreen/index.html", - //鍧″害鍒嗘瀽鍥惧眰 - esri: 'http://192.168.22.198:6080/arcgis/services/鏃犳爣棰�/MapServer/WMSServer?', + //鍧″害鍒嗘瀽鍥惧眰 + esri: 'http://'+ webArcgis +'/arcgis/services/moonnew/CE2DEM_slope2/MapServer/WMSServer?', //SDK璁稿彲 StaticFileBaseUrl: webUrl + "/WebSDK/", @@ -27,3 +26,4 @@ [">=", ">", " =", "<=", "<", "<>"], ], }; + diff --git a/src/assets/js/Map/menuTool.js b/src/assets/js/Map/menuTool.js index 8275b84..08e846a 100644 --- a/src/assets/js/Map/menuTool.js +++ b/src/assets/js/Map/menuTool.js @@ -6,7 +6,7 @@ // import { Store } from "vuex"; import store from "@/store"; import temporaryTool from "./temporaryTools"; - +import { getToken } from "@/utils/auth"; const menuTool = { toolMenu: null, toolFlag: null, @@ -174,10 +174,19 @@ }); }, + getLayrUrl(res) { + var url; + if (res.indexOf('{token}')>-1) { + const token = getToken(); + url = config.proxy + res.replaceAll("{token}", token); + } else { + url = res; + } + return url; + }, addTMSLayer(obj) { - var esri = new Cesium.WebMapServiceImageryProvider({ url: config.esri, name: 'esriLayer', @@ -645,6 +654,8 @@ window.rightViewer.imageryLayers.removeAll(); window.rightViewer = DoubleScreen.right._Viewer; window.rightViewer.animation.container.style.visibility = "hidden"; + window.rightViewer.scene.sun.show = false; //闅愯棌澶槼鍜屾湀浜� + window.rightViewer.scene.moon.show = false; // window.rightViewer.timeline.container.style.visibility = "hidden"; //澶ф皵灞� window.rightViewer.scene.globe.showGroundAtmosphere = false; diff --git a/src/assets/js/Map/olMap.js b/src/assets/js/Map/olMap.js index 2b0a562..65f8492 100644 --- a/src/assets/js/Map/olMap.js +++ b/src/assets/js/Map/olMap.js @@ -180,12 +180,11 @@ addWmts(res) { this.initMap(); - console.log(res) - console.log(res.category) if (res.category == 4) {//鍒ゆ柇鏄惁涓篈rcgis鏈嶅姟 addArcGisWmst(res); } else { addGeoWmst(res); + // addArcGisWmst(res) } }, }; @@ -271,21 +270,22 @@ }, 500); } function addArcGisWmst(res) { - console.log(res.url) + olMap.initMap(); var olMapDate = null; - if (res.url.indexOf('south') > -1) {//鍗楁瀬 + + if (res.cnName.indexOf('鍗楁瀬鎶曞奖') > -1) {//鍗楁瀬 olMapDate = proDate.south; - } else if (res.url.indexOf('north') > -1) {//鍖楁瀬 + } else if (res.cnName.indexOf('鍖楁瀬鎶曞奖') > -1) {//鍖楁瀬 olMapDate = proDate.north; - } else if (res.url.indexOf('near') > -1) {//鍖楁瀬 + } else if (res.cnName.indexOf('杩戝湴鎶曞奖') > -1) {//鍖楁瀬 olMapDate = proDate.near; - } else if (res.url.indexOf('far') > -1) {//鍖楁瀬 + } else if (res.cnName.indexOf('杩滃湴鎶曞奖') > -1) {//鍖楁瀬 olMapDate = proDate.far; - } else if (res.url.indexOf('equid') > -1) {//鍖楁瀬 + } else if (res.cnName.indexOf('绛夎窛绂�') > -1) {//鍖楁瀬 olMapDate = proDate.equid; } - console.log(res.url) + if(!olMapDate)return if(!olMapDate.extent)return; var extent = olMapDate.extent; @@ -303,7 +303,8 @@ }; ol.proj.addProjection(proj); var ResolutionsAndMids = getResolutionsAndMids(12); - var arcUrl = res.url; + var arcUrl =olMap.getLayrUrl( res); + var arcgisLayer = new ol.layer.Tile({ source: new ol.source.XYZ({ @@ -325,16 +326,13 @@ let mousePositionControl = new ol.control.MousePosition({ coordinateFormat: (coordinate) => { var sourceProj = mapCode; - console.log("yuanshi",mapCode) + var destProj = "ESRI:104903"; // 鐩爣鍧愭爣绯讳负澧ㄥ崱鎵樻姇褰� var olLon = coordinate[0] var olLat = coordinate[1]; - console.log(olLon, olLat) var destCoord = ol.proj.transform([olLon, olLat], sourceProj, destProj); - store.state.olLon = destCoord[0].toFixed(6) store.state.olLat = destCoord[1].toFixed(6); - if (olMap.map) { store.state.olZoom = parseInt(olMap.map.getView().getZoom()) } diff --git a/src/assets/js/Map/server.js b/src/assets/js/Map/server.js index df48ac6..74ee15b 100644 --- a/src/assets/js/Map/server.js +++ b/src/assets/js/Map/server.js @@ -265,7 +265,7 @@ ellipsoid: Cesium.Ellipsoid.MOON, }), }) - console.log("3123",urlTemplateImageryProvider.tilingScheme); + var imageLayer = window.Viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider); imageLayer.id = res.id diff --git a/src/views/layer/layerManage.vue b/src/views/layer/layerManage.vue index 6b86e42..e318c3d 100644 --- a/src/views/layer/layerManage.vue +++ b/src/views/layer/layerManage.vue @@ -486,7 +486,6 @@ var geoUrl = null; for (var i in son) { var layerArr = son[i]; - console.log(layerArr.isLayer); layerArr.checked = true; if (layerArr.category == 2 && layerArr.type == 3) { if (layerArr.tab != "moon:geo_mappable_unit") { -- Gitblit v1.9.3