Module

initCesium

初始化Cesium 对象

Parameters:
Name Type Description
params object
cesiumGlobal string

全局Cesium 对象

containerId string

挂载cesium 对象的dom id

threeGlobal string

全局的THREE对象

threeContainerId string

挂载THREEJS对象的dom id

extraConfig extraConfigOptions

二外配置,默认{}

imageryProvider providerConfOptions

provider 信息配置,默认{}

MapImageryList Array.<providerConfOptions>

配置imageLayer加载对象,默认[]

viewerConfig Cesium.Viewer.ConstructorOptions

同cesium viewer 配置参数,默认{}

defaultStatic string

静态数据配置

viewer Viewer

外部传入已经实例化的cesium对象viewer(注:如该参数不为空,插件将直接使用viewer,而不会重新执行 new Cesium.Viewer操作)

返回所有模块实例

Example
import * as Cesium from 'cesium';
import * as THREE from 'three';
import { initCesium } from 'cesium_dev_kit'
import { defaultStatic } from '/src/views/example/defaultStaticConf/index.js'
const {
     viewer,
          material:,
          graphics,
          math3d,
          math2d,
          primitive,
          draw,
          passEffect,
          customCesiumPlugin,
          control,
          plugin,
          base,
          analysis,
          attackArrowObj,
          straightArrowObj,
          pincerArrowObj,
          threeJs
        } =
  new initCesium({
            cesiumGlobal: Cesium,
            threeGlobal: THREE,
            containerId: 'cesiumContainer',
            threeContainerId: 'threeContainer',
            viewerConfig: {
              infoBox: false,
              shouldAnimate: true,
              useDefaultRenderLoop: false,
              selectionIndicator: false,
              sceneModePicker: false
            },
            extraConfig: {
              depthTest: true,
              AccessToken:"your access token"
            },
            imageryProvider: {
                type: "WebMapTileServiceImageryProvider",
                option: {
                  url: "http://t0.tianditu.gov.cn/img_w/wmts?tk=65a5f62a964c1d5b23fa81bc34147973",
                  layer: "img",
                  style: "default",
                  tileMatrixSetID: "w",
                  format: "tiles",
                  maximumLevel: 18,
                },
              },
            MapImageryList: [ {
                  type: 'UrlTemplateImageryProvider',
                  option: {
                    url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
                  }
                },
                {
                  type: 'UrlTemplateImageryProvider',
                  option: {
                    url: 'https://webst03.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&style=7',
                  }
                }],
            defaultStatic
          })