From 7acf7ad6948e3e952173a2551ea4a92a8ff56c35 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期四, 06 六月 2024 19:36:48 +0800 Subject: [PATCH] 1 --- src/assets/js/map/mapView.js | 41 +++++++++++++++++++++++++++-------------- 1 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/assets/js/map/mapView.js b/src/assets/js/map/mapView.js index 44cadf3..a73a0d2 100644 --- a/src/assets/js/map/mapView.js +++ b/src/assets/js/map/mapView.js @@ -1,18 +1,31 @@ +import mapServer from "./mapServer"; const mapViewer = { initMap() { - var earthCtrl = new SmartEarth.EarthCtrl("cesiumContainer", { - StaticFileBaseUrl: config.StaticFileBaseUrl, - }); - }, - setMapLocaTion(res) { + window.earthCtrl = new SmartEarth.EarthCtrl("sdkContainer", { + // 闅愯棌榛樿搴曞浘 + defaultImagery: false, + // 闅愯棌logo + printLog: false + // sceneMode: SmartEarth.Cesium.SceneMode.SCENE2D + }); + window.Cesium = SmartEarth.Cesium; + window.Viewer = earthCtrl.viewer; + Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString("#A9A9A9"); //璁剧疆鍦扮悆棰滆壊 + // 娓呯┖榛樿搴曞浘 + Viewer.imageryLayers.removeAll(); + + mapServer.addServer({ + sourceType: "arcgis", + url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" + }); + - }, - - - - - - -} -export default mapViewer; \ No newline at end of file + // mapServer.addServer({ + // sourceType: "geoserver", + // url: "https://cim.smartearth.cn/geoserver/PolygonFeature/ows", + // layer: "PolygonFeature:GeoEntity" + // }); + } +}; +export default mapViewer; -- Gitblit v1.9.3