You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 819B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @Author: Caven
  3. * @Date: 2021-03-12 16:45:45
  4. */
  5. import { registerLib } from '@dc-modules/global-api'
  6. const install = function(DC) {
  7. if (!DC) {
  8. throw new Error('Mapv: Missing DC Base')
  9. }
  10. registerLib('Cesium', DC.Namespace.Cesium)
  11. try {
  12. require('mapv-lib/mapv.min.js')
  13. DC.Namespace['mapv'] = window.mapv
  14. registerLib('mapv', DC.Namespace['mapv'])
  15. DC.mixin(require('./src/components.js').default)
  16. DC.mixin({
  17. MapvDataSet: window.mapv?.DataSet
  18. })
  19. } catch (e) {
  20. // eslint-disable-next-line no-console
  21. console.error(e)
  22. } finally {
  23. delete window['mapv']
  24. }
  25. }
  26. /* istanbul ignore if */
  27. if (typeof window !== 'undefined' && window.DC) {
  28. install(window.DC)
  29. }
  30. export default {
  31. name: 'dc-mapv',
  32. version: __VERSION__,
  33. compile_time: __TIME__,
  34. install
  35. }