1
suerprisePlus
2024-06-06 7acf7ad6948e3e952173a2551ea4a92a8ff56c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import mapServer from "./mapServer";
 
const mapViewer = {
  initMap() {
    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"
    });
   
    
    // mapServer.addServer({
    //   sourceType: "geoserver",
    //   url: "https://cim.smartearth.cn/geoserver/PolygonFeature/ows",
    //   layer: "PolygonFeature:GeoEntity"
    // });
  }
};
export default mapViewer;