Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @Author: Caven
  3. * @Date: 2021-03-13 13:15:38
  4. */
  5. import { add } from '@dc-modules/namespace/NSManager'
  6. const install = function(DC) {
  7. if (!DC || !DC.init) {
  8. throw new Error('Missing DC Base Package')
  9. }
  10. add('Cesium', DC.Namespace.Cesium)
  11. add('turf', DC.Namespace.turf)
  12. /**
  13. * start
  14. */
  15. DC.ready = callback => {
  16. try {
  17. if (!DC.Initialized) {
  18. // load components
  19. try {
  20. DC.mixin(require('./src/components.js').default)
  21. require('@dc-modules/copy-right')
  22. if (DC.baseUrl) {
  23. const { Cesium } = DC.Namespace
  24. Cesium && Cesium.buildModuleUrl.setBaseUrl(DC.baseUrl)
  25. }
  26. DC.Initialized = true
  27. callback && callback()
  28. } catch (e) {
  29. // eslint-disable-next-line no-console
  30. console.error(e)
  31. DC.Initialized = false
  32. }
  33. } else {
  34. callback && callback()
  35. }
  36. } catch (e) {
  37. // eslint-disable-next-line no-console
  38. console.error(e)
  39. DC.Initialized = false
  40. throw e
  41. }
  42. }
  43. }
  44. /* istanbul ignore if */
  45. if (typeof window !== 'undefined' && window.DC) {
  46. install(window.DC)
  47. }
  48. export default {
  49. name: 'dc-core',
  50. version: __VERSION__,
  51. compile_time: __TIME__,
  52. install
  53. }