suerprisePlus
2024-06-27 6ae4841b48665145aa469d574fbadb988a9c498c
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
32
33
34
35
36
37
38
39
40
41
42
import axios from "axios";
import mapConfig from "./mapConfig";
import mapServer from "./mapServer";
import modelLayer from "./modelLayer";
import wfsConfig from "./wfsConfig";
import mapInfo from "./mapInfo";
import layerJson from "./mapJsonLayer";
 
const mapViewer = {
  configTooles: null,
  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();
  //   earthCtrl.factory.createTerrainLayer({sourceType: "ctb",
  //     url: 'https://tiles1.geovisearth.com/base/v1/terrain?token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405'
  // });
    mapServer.addServer({
      sourceType: "arcgis",
      url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
    });
    mapServer.addServer({
      sourceType: "tms",
      url: "http://192.168.11.41:9001/gisserver/tmsserver/SubicBayArea"
    });
    
    modelLayer.init();
    mapInfo.setEntityQueryInput();
    // const url = layerJson.getQueryUrl("SubicBayAreaVector_wfs", "GeoEntity");
    // layerJson.init(url);
  }
};
export default mapViewer;