| @@ -2,11 +2,13 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-27 14:29:05 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-12 19:22:21 | |||
| * @Last Modified time: 2020-02-13 00:57:13 | |||
| */ | |||
| ;(function() { | |||
| let namespace = {} | |||
| let initialized = false | |||
| let DC = { | |||
| Http: undefined, | |||
| Version: '1.0.0', | |||
| @@ -14,12 +16,11 @@ | |||
| } | |||
| delete window.DC | |||
| window.DC = DC | |||
| require('../log') | |||
| function requireCesium() { | |||
| let requireCesium = () => { | |||
| return new Promise((resolve, reject) => { | |||
| let Cesium = require('cesium/Cesium') | |||
| namespace['Cesium'] = Cesium | |||
| @@ -27,24 +28,32 @@ | |||
| }) | |||
| } | |||
| /** | |||
| * | |||
| */ | |||
| DC.noConflict = (newVal = 'DC') => { | |||
| delete window[newVal] | |||
| window[newVal] = window.DC | |||
| } | |||
| /** | |||
| * namespace | |||
| */ | |||
| DC.getNamespace = function() { | |||
| DC.getNamespace = () => { | |||
| return namespace | |||
| } | |||
| /** | |||
| * start | |||
| */ | |||
| DC.init = function(callback) { | |||
| DC.init = callback => { | |||
| DC.ready(callback) | |||
| } | |||
| /** | |||
| * start | |||
| */ | |||
| DC.ready = function(callback) { | |||
| DC.ready = callback => { | |||
| try { | |||
| if (!initialized) { | |||
| requireCesium().then(() => { | |||
| @@ -2,12 +2,12 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-14 18:22:10 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-02-04 19:03:08 | |||
| * @Last Modified time: 2020-02-13 00:50:28 | |||
| */ | |||
| ;(function() { | |||
| let initialized = false | |||
| if (!DC) { | |||
| throw new Error('missing dc sdk') | |||
| console.error('missing dc sdk') | |||
| } | |||
| DC.init(() => { | |||
| !initialized && require('./DC.Pulgins.Loader') | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2019-12-30 09:35:51 | |||
| * @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' | |||
| @@ -17,7 +17,9 @@ DC.SceneMode = Cesium.SceneMode | |||
| DC.CallbackProperty = Cesium.CallbackProperty | |||
| DC.JulianDate = Cesium.JulianDate | |||
| DC.Math = Cesium.Math | |||
| DC.ClassificationType = Cesium.ClassificationType | |||
| DC.PolylineDashMaterialProperty = Cesium.PolylineDashMaterialProperty | |||
| DC.PolylineGlowMaterialProperty = Cesium.PolylineGlowMaterialProperty | |||
| DC.PolylineOutlineMaterialProperty = Cesium.PolylineOutlineMaterialProperty | |||
| DC.PolylineArrowMaterialProperty = Cesium.PolylineArrowMaterialProperty | |||