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

不引入jquery的情况下地图初始化失败 #4

Open
loulin opened this issue Aug 28, 2015 · 2 comments
Open

不引入jquery的情况下地图初始化失败 #4

loulin opened this issue Aug 28, 2015 · 2 comments

Comments

@loulin
Copy link

loulin commented Aug 28, 2015

下载 http://anypossiblew.github.io/ui-map-baidu 安装运行后可重现:

TypeError: Cannot read property 'Ub' of undefined
    at La.w.extend.wn (getscript?v=2.0&ak=kp3ODQt4pkpHMW2Yskl2Lwee&services=&t=20150827150751:1)
    at La.w.extend.ae (getscript?v=2.0&ak=kp3ODQt4pkpHMW2Yskl2Lwee&services=&t=20150827150751:1)
    at initMap (ui-map.js:127)
    at ui-map.js:105
    at m.$get.m.$broadcast (angular.js:16038)
    at mapbaiduLoadedCallback (ui-map.js:263)
    at Object.window.BMap.apiLoad [as HT] (api?v=2.0&ak=kp3ODQt4pkpHMW2Yskl2Lwee&callback=mapbaiduLoadedCallback:1)
    at getscript?v=2.0&ak=kp3ODQt4pkpHMW2Yskl2Lwee&services=&t=20150827150751:1
    at getscript?v=2.0&ak=kp3ODQt4pkpHMW2Yskl2Lwee&services=&t=20150827150751:1
@loulin
Copy link
Author

loulin commented Aug 29, 2015

并且ui-map-async-load指令不能写在template中,否则如果设置了cache,在route切换时会导致initMap执行两遍,第二次执行会覆盖为空白地图。
所以只能写在顶层dom比如body中,但是这样就没有异步加载的意义了。

@anypossiblew
Copy link
Owner

有道理,能否展示一下你的解决方案?

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