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 828B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. * @Author: Caven
  3. * @Date: 2021-03-12 16:45:45
  4. */
  5. import { setNamespace } from '@dc-modules/namespace'
  6. const install = function(DC) {
  7. if (!DC || !DC.init) {
  8. throw new Error('Mapv: Missing DC Base')
  9. }
  10. DC.init(() => {
  11. try {
  12. require('mapv-lib/mapv.min.js')
  13. DC.Namespace['mapv'] = window.mapv
  14. setNamespace('mapv', window.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. }
  27. /* istanbul ignore if */
  28. if (typeof window !== 'undefined' && window.DC) {
  29. install(window.DC)
  30. }
  31. export default {
  32. name: 'dc-mapv',
  33. version: __VERSION__,
  34. compile_time: __TIME__,
  35. install
  36. }