|
|
|
@@ -6,7 +6,6 @@ import { getLib, registerLib } from './global-api/lib-utils.js' |
|
|
|
export { registerLib, getLib } from './global-api/lib-utils.js' |
|
|
|
|
|
|
|
let _baseUrl = './libs/dc-sdk/resources/' |
|
|
|
let _accessToken = '' |
|
|
|
|
|
|
|
export const config = { |
|
|
|
set baseUrl(baseUrl) { |
|
|
|
@@ -15,21 +14,12 @@ export const config = { |
|
|
|
get baseUrl() { |
|
|
|
return _baseUrl |
|
|
|
}, |
|
|
|
set accessToken(accessToken) { |
|
|
|
_accessToken = accessToken |
|
|
|
}, |
|
|
|
get accessToken() { |
|
|
|
return _accessToken |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
export function ready(options = {}) { |
|
|
|
if (options['baseUrl']) { |
|
|
|
this.config.baseUrl = options['baseUrl'] |
|
|
|
} |
|
|
|
if (options['accessToken']) { |
|
|
|
this.config.accessToken = options['accessToken'] |
|
|
|
} |
|
|
|
|
|
|
|
if (options['Cesium']) { |
|
|
|
registerLib('Cesium', options['Cesium']) |
|
|
|
@@ -41,10 +31,6 @@ export function ready(options = {}) { |
|
|
|
registerLib('echarts', options['echarts']) |
|
|
|
} |
|
|
|
|
|
|
|
// if (options['turf']) { |
|
|
|
// registerLib('turf', options['turf']) |
|
|
|
// } |
|
|
|
|
|
|
|
this['__cmdOut'] && this['__cmdOut']() |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
@@ -66,9 +52,9 @@ export function ready(options = {}) { |
|
|
|
}) |
|
|
|
// register math module |
|
|
|
if (this['Math']) { |
|
|
|
const funcs = require('./modules/math') |
|
|
|
Object.keys(funcs).forEach((key) => { |
|
|
|
this['Math'][key] = funcs[key] |
|
|
|
const maths = require('./modules/math') |
|
|
|
Object.keys(maths).forEach((key) => { |
|
|
|
this['Math'][key] = maths[key] |
|
|
|
}) |
|
|
|
} |
|
|
|
// register chart module |
|
|
|
@@ -78,11 +64,6 @@ export function ready(options = {}) { |
|
|
|
this[key] = modules[key] |
|
|
|
}) |
|
|
|
} |
|
|
|
// register turf module |
|
|
|
if (getLib('turf')) { |
|
|
|
// todo |
|
|
|
} |
|
|
|
|
|
|
|
resolve() |
|
|
|
}).catch((e) => { |
|
|
|
throw new Error(e.message) |