ソースを参照

Merge branch 'dev'

tags/1.0.0
Caven 5年前
コミット
110d138312
3個のファイルの変更20行の追加9行の削除
  1. 15
    6
      src/core/DC.js
  2. 2
    2
      src/plugins/DC.Pulgins.js
  3. 3
    1
      src/thirdpart/index.js

+ 15
- 6
src/core/DC.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2019-12-27 14:29:05 * @Date: 2019-12-27 14:29:05
* @Last Modified by: Caven * @Last Modified by: Caven
* @Last Modified time: 2020-02-12 19:22:21
* @Last Modified time: 2020-02-13 00:57:13
*/ */
;(function() { ;(function() {
let namespace = {} let namespace = {}

let initialized = false let initialized = false

let DC = { let DC = {
Http: undefined, Http: undefined,
Version: '1.0.0', Version: '1.0.0',
} }


delete window.DC delete window.DC

window.DC = DC window.DC = DC


require('../log') require('../log')


function requireCesium() {
let requireCesium = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let Cesium = require('cesium/Cesium') let Cesium = require('cesium/Cesium')
namespace['Cesium'] = Cesium namespace['Cesium'] = Cesium
}) })
} }


/**
*
*/
DC.noConflict = (newVal = 'DC') => {
delete window[newVal]
window[newVal] = window.DC
}

/** /**
* namespace * namespace
*/ */
DC.getNamespace = function() {
DC.getNamespace = () => {
return namespace return namespace
} }


/** /**
* start * start
*/ */
DC.init = function(callback) {
DC.init = callback => {
DC.ready(callback) DC.ready(callback)
} }


/** /**
* start * start
*/ */
DC.ready = function(callback) {
DC.ready = callback => {
try { try {
if (!initialized) { if (!initialized) {
requireCesium().then(() => { requireCesium().then(() => {

+ 2
- 2
src/plugins/DC.Pulgins.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2020-01-14 18:22:10 * @Date: 2020-01-14 18:22:10
* @Last Modified by: Caven * @Last Modified by: Caven
* @Last Modified time: 2020-02-04 19:03:08
* @Last Modified time: 2020-02-13 00:50:28
*/ */
;(function() { ;(function() {
let initialized = false let initialized = false
if (!DC) { if (!DC) {
throw new Error('missing dc sdk')
console.error('missing dc sdk')
} }
DC.init(() => { DC.init(() => {
!initialized && require('./DC.Pulgins.Loader') !initialized && require('./DC.Pulgins.Loader')

+ 3
- 1
src/thirdpart/index.js ファイルの表示

* @Author: Caven * @Author: Caven
* @Date: 2019-12-30 09:35:51 * @Date: 2019-12-30 09:35:51
* @Last Modified by: Caven * @Last Modified by: Caven
* @Last Modified time: 2020-02-11 23:04:08
* @Last Modified time: 2020-02-13 00:53:36
*/ */
import Cesium from '@/namespace' import Cesium from '@/namespace'


DC.CallbackProperty = Cesium.CallbackProperty DC.CallbackProperty = Cesium.CallbackProperty
DC.JulianDate = Cesium.JulianDate DC.JulianDate = Cesium.JulianDate
DC.Math = Cesium.Math DC.Math = Cesium.Math
DC.ClassificationType = Cesium.ClassificationType


DC.PolylineDashMaterialProperty = Cesium.PolylineDashMaterialProperty DC.PolylineDashMaterialProperty = Cesium.PolylineDashMaterialProperty
DC.PolylineGlowMaterialProperty = Cesium.PolylineGlowMaterialProperty DC.PolylineGlowMaterialProperty = Cesium.PolylineGlowMaterialProperty
DC.PolylineOutlineMaterialProperty = Cesium.PolylineOutlineMaterialProperty DC.PolylineOutlineMaterialProperty = Cesium.PolylineOutlineMaterialProperty
DC.PolylineArrowMaterialProperty = Cesium.PolylineArrowMaterialProperty

読み込み中…
キャンセル
保存