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

使用高德版本 v:2.0 之后 绑定evenet 报请等待地图加载完毕之后再进行绑定事件错误 #684

Open
LiveAckerman opened this issue Jul 4, 2022 · 5 comments

Comments

@LiveAckerman
Copy link

问题

使用高德版本 v:2.0 之后 绑定evenet 报请等待地图加载完毕之后再进行绑定事件错误
Error in event handler for "AMAP_READY_EVENT": "Error: please wait for Map API load"
please wait for Map API load

VueAMap 版本

最新npm版本

OS/Browsers version

谷歌

Vue 版本

v2.6.11

复现地址

预期

能正常绑定事件

实际

绑定事件失败

feature request

@LiveAckerman
Copy link
Author

image

@LiveAckerman
Copy link
Author

image
不进行event绑定就不会报错

@LiveAckerman
Copy link
Author

image

@LiveAckerman
Copy link
Author

找到原因了 新版高德地图将event改成Event了 导致 源码中这个判断过不了
image
解决办法为 在 vue的created 增加 window.AMap.event = window.AMap.Event;
image

@yangyanggu
Copy link

推荐用 @vuemap/vue-amap

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