| export * from './mixin' | export * from './mixin' | ||||
| export * from './use' | export * from './use' | ||||
| export * from './lib-util' |
| /** | |||||
| * @Author: Caven | |||||
| * @Date: 2022-08-11 18:52:22 | |||||
| */ | |||||
| const cache = {} | |||||
| export function registerLib(name, lib) { | |||||
| cache[name] = lib | |||||
| } | |||||
| export function getlib(name) { | |||||
| return cache[name] | |||||
| } |
| /** | |||||
| * @Author: Caven | |||||
| * @Date: 2022-08-02 19:28:40 | |||||
| */ | |||||
| const cahce = {} | |||||
| export function add(name, lib) { | |||||
| cahce[name] = lib | |||||
| } | |||||
| export function get(name) { | |||||
| return cahce[name] | |||||
| } | |||||
| export function getCesium() { | |||||
| return cahce['Cesium'] | |||||
| } | |||||
| export function getTurf() { | |||||
| return cahce['turf'] | |||||
| } | |||||
| export function getMapv() { | |||||
| return cahce['mapv'] | |||||
| } |
| * @Date: 2020-02-02 15:55:53 | * @Date: 2020-02-02 15:55:53 | ||||
| */ | */ | ||||
| import { add } from '@dc-modules/namespace/NSManager' | |||||
| import { registerLib } from '@dc-modules/global-api' | |||||
| const install = function(DC, echarts) { | const install = function(DC, echarts) { | ||||
| echarts = echarts || global.echarts | echarts = echarts || global.echarts | ||||
| throw new Error('Chart: missing charts lib') | throw new Error('Chart: missing charts lib') | ||||
| } | } | ||||
| if (!DC || !DC.init) { | |||||
| if (!DC) { | |||||
| throw new Error('Chart: Missing DC Base') | throw new Error('Chart: Missing DC Base') | ||||
| } | } | ||||
| try { | try { | ||||
| add('Cesium', DC.Namespace.Cesium) | |||||
| registerLib('Cesium', DC.Namespace.Cesium) | |||||
| DC.mixin(require('./src/components.js').default) | DC.mixin(require('./src/components.js').default) | ||||
| } catch (e) { | } catch (e) { | ||||
| // eslint-disable-next-line no-console | // eslint-disable-next-line no-console |
| * @Date: 2021-03-13 13:15:38 | * @Date: 2021-03-13 13:15:38 | ||||
| */ | */ | ||||
| import { add } from '@dc-modules/namespace/NSManager' | |||||
| import { registerLib } from '@dc-modules/global-api' | |||||
| const install = function(DC) { | const install = function(DC) { | ||||
| if (!DC || !DC.init) { | |||||
| if (!DC) { | |||||
| throw new Error('Missing DC Base Package') | throw new Error('Missing DC Base Package') | ||||
| } | } | ||||
| add('Cesium', DC.Namespace.Cesium) | |||||
| add('turf', DC.Namespace.turf) | |||||
| registerLib('Cesium', DC.Namespace.Cesium) | |||||
| registerLib('turf', DC.Namespace.turf) | |||||
| /** | /** | ||||
| * start | * start |
| * @Date: 2021-03-12 16:45:45 | * @Date: 2021-03-12 16:45:45 | ||||
| */ | */ | ||||
| import { add } from '@dc-modules/namespace/NSManager' | |||||
| import { registerLib } from '@dc-modules/global-api' | |||||
| const install = function(DC) { | const install = function(DC) { | ||||
| if (!DC || !DC.init) { | |||||
| if (!DC) { | |||||
| throw new Error('Mapv: Missing DC Base') | throw new Error('Mapv: Missing DC Base') | ||||
| } | } | ||||
| add('Cesium', DC.Namespace.Cesium) | |||||
| registerLib('Cesium', DC.Namespace.Cesium) | |||||
| try { | try { | ||||
| require('mapv-lib/mapv.min.js') | require('mapv-lib/mapv.min.js') | ||||
| DC.Namespace['mapv'] = window.mapv | DC.Namespace['mapv'] = window.mapv | ||||
| add('mapv', DC.Namespace['mapv']) | |||||
| registerLib('mapv', DC.Namespace['mapv']) | |||||
| DC.mixin(require('./src/components.js').default) | DC.mixin(require('./src/components.js').default) | ||||
| DC.mixin({ | DC.mixin({ | ||||
| MapvDataSet: window.mapv?.DataSet | MapvDataSet: window.mapv?.DataSet |
| * @Date: 2021-03-12 16:45:45 | * @Date: 2021-03-12 16:45:45 | ||||
| */ | */ | ||||
| import { add } from '@dc-modules/namespace/NSManager' | |||||
| import { registerLib } from '@dc-modules/global-api' | |||||
| const install = function(DC) { | const install = function(DC) { | ||||
| if (!DC || !DC.init) { | |||||
| if (!DC) { | |||||
| throw new Error('Mapv: Missing DC Base') | throw new Error('Mapv: Missing DC Base') | ||||
| } | } | ||||
| add('Cesium', DC.Namespace.Cesium) | |||||
| registerLib('Cesium', DC.Namespace.Cesium) | |||||
| try { | try { | ||||
| DC.mixin(require('./src/components.js').default) | DC.mixin(require('./src/components.js').default) | ||||
| } catch (e) { | } catch (e) { |