fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import * as mars3d from "mars3d"
export let map
 
function initMap() {
  // 读取 config.json 配置文件
  return mars3d.Util.fetchJson({ url: "config/config.json" }).then(function (json) {
    console.log("读取 config.json 配置文件完成", json) // 打印测试信息
 
    // 创建三维地球场景
    const mapOptions = json.map3d
    map = new mars3d.Map("mars3dContainer", mapOptions)
 
    // 打印测试信息
    console.log("mars3d的Map主对象构造完成", map)
    console.log("其中Cesium原生的Cesium.Viewer为", map.viewer)
    return map
  })
}