-
Notifications
You must be signed in to change notification settings - Fork 99
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
ios下没有返回逆编码信息 #71
Comments
先确定返回的坐标是不是国内的 |
返回的坐标是国内的,使用Geolocation.getCurrentPosition,返回一次坐标,没有返回逆编码信息。使用watchPosition,第一次返回4次坐标信息,后2次有逆编码信息。但是需求是单次定位,在需要的时候获得一次定位信息,倾向于使用Geolocation.getCurrentPosition,但是没有返回逆编码信息,有什么解决方案吗? |
我之前设置了setLocatingWithReGeocode(true),然后有了code信息,然后这几天也没有了 |
我很确定之前是有逆地理编码信息的,坐标也在国内,现在又没有了 |
貌似是持续定位的前几次获取不到之后能取到 |
单次调用确实不一定能获取到逆地理编码 |
我这就获取到一次逆地理编码,怎么解决呢,急急急,确定是中国坐标 |
目前我的解决方案是,先设置setLocatingWithReGeocode(true),然后调用Geolocation .watchPosition(),然后调用Geolocation.clearWatch() 结束监听。这样使用Geolocation.getCurrentPosition就能拿到你地址信息了。 |
实测取不到地址信息,很奇怪。在调试模式下,我开启了hotloading 保存下代码后自动刷新就能拿到了,但正常调用是无论如何都拿不到的 |
经过各种尝试,已经发现问题,是init方法异步执行导致的。将init放到应用初始化时执行,而不是每次用到定位都执行一次初始化,就能正常获取地理位置信息了 |
定位没有返回逆编码信息,设置了
setLocatingWithReGeocode(true)和setNeedAddress(true);
The text was updated successfully, but these errors were encountered: