CLLocationManager是否可以在没有Internet /蜂窝连接的情况下工作? [英] Does CLLocationManager work without internet/cellular connection?

查看:70
本文介绍了CLLocationManager是否可以在没有Internet /蜂窝连接的情况下工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

傻问题!!虽然我想知道CLLocationManager是否可以在没有Internet的情况下工作?????

Silly question !! Though I want to know that is it possible that CLLocationManager works without Internet ?????

即iPhone根本没有连接到互联网

i.e. iPhone is not connected to internet at all

推荐答案

iPhoneiPadDev的答案略有错误:有时位置管理器将失败,它可以在没有网络连接的情况下工作。如果您想亲自体验一下,可以去蜂窝信号接收糟糕或根本不存在的地方开车:GPS仍然可以工作。

iPhoneiPadDev's answer is slightly wrong: whilst sometimes the location manager will fail, it can work without network connectivity. If you want to see this for yourself, go for a drive somewhere with terrible or nonexistent cellular reception: GPS will still work.

这在很大程度上取决于周围的环境条件您和您使用的设备。 iPod Touch和某些iPad没有GPS,而是依靠WiFi热点来确定其位置数据。如果您没有网络访问权限,则 CLLocationManager 将返回无效的位置。

It very much depends on the environmental conditions around you, and the device you're using. iPod Touches and some iPads don't have GPS, and rely on WiFi hotspots to determine their location data. If you don't have network access the CLLocationManager will return an invalid location.

iPhone和3G iPad 具有GPS,因此您可能会获得合适的位置。 但是,他们使用A-GPS(辅助GPS),该GPS使用来自网络的信息来更快地锁定GPS。如果您没有互联网连接,则GPS芯片可能需要一些时间来获取信号并提供准确的位置:如果您在室内或看不到天空,那么精度可能会大打折扣。

iPhones and 3G iPads do have GPS, so you may get an appropriate location returned. However, they use A-GPS (assisted GPS), which uses information from the network to allow a faster GPS lock. If you don't have internet connectivity it may take some time for the GPS chip to obtain a signal and provide an accurate location: and accuracy may be wildly off, if you're indoors or don't have plain sight of the sky.

重要点 CLLocationManager 可以并且将返回您的位置,即使没有可用的位置:但是,坐标将无效。重要的是要测试返回的位置,并在使用它们之前确保您对它们的正确性感到满意。

Important point: CLLocationManager can and will return you locations even if none are available: the coordinates, however, will be invalid. It's important to test the locations being returned and make sure you're satisfied they are correct before using them.

这篇关于CLLocationManager是否可以在没有Internet /蜂窝连接的情况下工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆