cordova-baidu-location icon indicating copy to clipboard operation
cordova-baidu-location copied to clipboard

" baidu_location" 提示未定义

Open liershijiu opened this issue 7 years ago • 8 comments

直接使用 baidu_location 提示未定义

liershijiu avatar Aug 16 '17 02:08 liershijiu

you probably need to wait until the plugin is completely loaded. Use it in a timeout function and try again?

hewz avatar Aug 16 '17 02:08 hewz

多谢

liershijiu avatar Aug 16 '17 03:08 liershijiu

我在angular4+ionic3的项目中用的,按照您的方法,还是会报"baidu_location"未定义的错误。求解答

jinzis avatar Aug 16 '17 06:08 jinzis

我刚刚解决了, 加上这个 ,然后生成APP 测试

发自网易邮箱大师

在2017年8月16日 14:22,jinxin[email protected] 写道:

我在angular4+ionic3的项目中用的,按照您的方法,还是会报"baidu_location"未定义的错误。求解答

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

liershijiu avatar Aug 16 '17 06:08 liershijiu

最好是 cordova platform rm android cordova platform add android --nofetch

发自网易邮箱大师

在2017年8月16日 14:22,jinxin[email protected] 写道:

我在angular4+ionic3的项目中用的,按照您的方法,还是会报"baidu_location"未定义的错误。求解答

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

liershijiu avatar Aug 16 '17 06:08 liershijiu

邮箱发的贴的图 这里看不到 . 先 定义 一下declare let baidumap_location: any; 代码不报错了 ,在生成APP在手机上测试.

liershijiu avatar Aug 16 '17 07:08 liershijiu

@jinzis ionic3 + angular "baidu_location"未定义的错误解决了吗?请问是如何解决的?

zhuguoliangAI avatar Jan 23 '18 08:01 zhuguoliangAI

@hewz 部分手机(如小米)首次进入app调用定位会失败,点击其它页面再进入首页时可以成功调用,查看您关闭的issue,在Java代码中注释了那几段代码还是不行,目前用了个比较笨的办法,首次进入app调用插件时加了个timeout即可行,但这确实不是最佳做法,如果有时间能否看下这个问题。

Shawyau avatar Jan 24 '18 07:01 Shawyau