Skip to content
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

异步加载的百度地图无法渲染图层 #92

Open
lzwzzy opened this issue Aug 15, 2019 · 3 comments
Open

异步加载的百度地图无法渲染图层 #92

lzwzzy opened this issue Aug 15, 2019 · 3 comments

Comments

@lzwzzy
Copy link

lzwzzy commented Aug 15, 2019

我使用异步加载的百度地图,在vue中使用,但是无法加载图层,如果全局引入的话,就可以

@fengluhome
Copy link
Contributor

inmap在底层实现的时候继承了百度的地图overlay类,prototype 方式继承, 所以在js引擎解析的时候,必须baidumap 对象先存在,所以提的问题是模块依赖问题,如果你想异步加载地图,inmap依赖百度地图,也需要异步加载。

@lzwzzy
Copy link
Author

lzwzzy commented Aug 19, 2019

大神能提点下如何在vue中农异步加载inmap吗?

@fengluhome
Copy link
Contributor

require(['inmap'],(module)=>{

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants