From 92291bdc16443dca885956d74644f2abe04eaf6f Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期五, 15 九月 2023 17:10:46 +0800 Subject: [PATCH] 经纬度网格,SDK版本更新 --- src/assets/js/Map/server.js | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/src/assets/js/Map/server.js b/src/assets/js/Map/server.js index a140f51..ccce9ab 100644 --- a/src/assets/js/Map/server.js +++ b/src/assets/js/Map/server.js @@ -4,6 +4,7 @@ import store from "@/store"; const server = { layerList: [], + graticules: null, addTreeData(treeNode) { if (!treeNode.checked) { this.delLayer(treeNode.id); @@ -15,6 +16,29 @@ } else { this.addUrlAddress(treeNode); //鏃犱唬鐞� } + + if (this.graticules) { + window.Viewer.imageryLayers.raiseToTop(this.graticules.imageryLayer); + } + }, + showlonlatLine() { + if (!this.graticules) { + SmartEarth.Cesium.Ellipsoid.WGS84 = new SmartEarth.Cesium.Ellipsoid(1737400.0, 1737400.0, 1737400.0) + + this.graticules = new SmartEarth.Cesium.Graticules( + earthCtrl.Viewer, + SmartEarth.Cesium.Color.PALEGREEN + ); + // graticules.makeCoordAxiss(); + var that = this; + earthCtrl.Viewer.scene.preUpdate.addEventListener(function () { + that.graticules.update(); + }); + } else { + this.graticules.enabled = !this.graticules.enabled + } + + }, //浠g悊鍦板潃 addProxyAddress(res) { @@ -390,6 +414,7 @@ }); layer.name = `Wms_Layer${res.id}`; let img_layer = window.Viewer.imageryLayers.addImageryProvider(layer); + this.layerList.push({ id: res.id, layerData: img_layer, type: "wmts" }); }, addGeoServerMmsLayers(layer, url) { -- Gitblit v1.9.3