CLLocationManager 确保 iPhone 的最佳准确性
有人对如何在位置管理器上获得最佳水平精度有任何建议吗? 我已将所需的精度设置为 NearestTenMeters,但考虑到精度始终会根据覆盖区域而变化,如何在 locationManager 中编写一些代码以仅在获得最佳水平精度后停止更新?
Does anyone have any suggestions on how to obtain the best horizontal accuracy on the location manager? I have set the desired accuracy to NearestTenMeters, but given that the accuracy can always change depending on coverage area, how can I write some code in the locationManager to stop updating only after I get the best horizontal accuracy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您希望它达到一定的精度,请将委托方法设置
为具有
类似的值。
If you want it to be to a certain accuracy, set the delegate method
to have
something like that.
通常,硬件开启的时间越长,获得的位置越多,获得的准确度就越高。 您可以尝试尽早打开管理器,让它变得准确,然后抓取位置。 当目标移动时,它也有帮助,当 GPS 移动时,芯片能够获得更准确的读数。 此外,设备的位置也会有所不同,如果您在野外,您将获得比在沙坑中更好的读数,因此有时您获得的读数是可用的最佳读数。 您的代码可以等待一段时间,直到它不再从位置管理器获得更新,然后它可能处于最佳准确性。
Typically the longer the hardware is on and the more locations it gets the more accurate it gets. You can try turning on the manager early to let it get accurate and then grab the location. It also helps when the target is moving, the chip is able to get more accurate readings when gps is moving. Also the location of the device makes a diffrence, you will get much better reads if you are outside on a field than if you are in a bunker, so sometimes the read you get is the best thats available. Your code can wait till it gets no more updates from location manager for some time, then its probably at its best accuracy.