-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于高德地图、百度地图、腾讯地图的接入 #1009
Labels
docs
Improvements or additions to documentation
Comments
This was referenced Dec 13, 2023
Closed
Closed
Closed
按照目前操作,子应用直接window.TMap还是会报错TypeError: Cannot read properties of undefined (reading 'id') |
目前问题已解决~ |
子应用要怎么引入主应用的插件呀?一直都没有找到实例,都块要放弃了 |
这个应该不支持 GL 版本的百度地图吧, 我看 GL版本的使用了 document.write 两个静态资源, 并且在其中一个静态资源中会执行并加载很多文件,其中文件都会报错 BMapGL 为空, 因为执行环境不一样 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
高德地图、百度地图、腾讯地图属于第三方资源,在接入微前端时无法控制资源跨域性设置,故在接入micro-app时需要注意下以下细节
接入步骤如下:
1、确保子应用在接入微前端micro-app前,本身是可以正常跑起来的
2、接入微前端:在微前端的主应用的出口html 中,引入sdk,其中对应的地图sdk 如下:
3、在主应用的micro中,配置插件,书写忽略文件【目的:忽略子应用中直接获取地图相关js 文件时的跨域等问题,将资源提升到到主应用中加载声明】,各种地图插件配置如下:
4、发展:目前插件正在审核发版,稍后会发布插件,提高使用方的地图接入效率
The text was updated successfully, but these errors were encountered: