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.

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