CLLocationManager 获取当前位置需要 wifi 或 3G 吗? - iPhone
CLLocationManager getCurrentLocation 可以在没有 wifi 或蜂窝网络的情况下工作吗?使用内置 GPS? 谢谢。
Can CLLocationManager getCurrentLocation work without wifi or a cellular network? with the inbuilt GPS?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 iPod Touch,是的。
对于 iPhone 来说,没有。
iPod Touch 没有内置 GPS 接收器,它使用 WiFi 热点签名进行近似。
iPhone 确实有内置 GPS 接收器,因此无需 3G 或 WiFi 也能正常工作。
证明?沿着高速公路行驶,您将脱离 3G/Edge 网络,但 Google 地图仍会跟踪您当前的位置。
For iPod Touch, yes.
For iPhone, no.
iPod Touch doesn't have a built-in GPS receiver and it uses WiFi hot spot signatures for approximation.
The iPhone does have a built-in GPS receiver, so it works fine without 3G or WiFi.
Proof? Drive down the thruway and you'll go outside of 3G/Edge network, but Google Maps still tracks your current location.
我找不到任何文件来证实是或否,但根据我的经验,我会说是。核心位置使用手机信号塔、wifi 和 GPS 来查找您的位置,因此如果其中一两个服务不可用,我会假设系统会使用它可以使用的任何资源。如果它似乎不起作用,可能是(我只是在这里猜测)您必须将所需的精度设置为较高的值(尝试 kCLLocationAccuracyBest)才能启动 GPS。
如果您还没有,观看视频“Core Location 的新增功能”https://developer.apple.com/videos/wwdc/2011/index.php
I cannot find any documentation that confirms either yes or no, but from my experience I'd say yes. Core Location uses cell towers, wifi, and gps together to find your location so if one or two of the services are unavailable I would assume the system would use whatever resource it can. If it doesn't seem to work, it could be (I'm just guessing here) that you have to set the desired accuracy to something high (try kCLLocationAccuracyBest) in order for GPS to kick in.
If you haven't already, check out the video "What's new in Core Location" https://developer.apple.com/videos/wwdc/2011/index.php
如果您想获取 GPS,请在关闭 3G 和 wifi 后转到地图,然后单击底部的位置图标。然后你会看到正在加载,然后它会给你当前位置
if you want to get the gps go to maps, after turning the 3g and wifi off, and click the location icon on the bottom. then you will see loading and then it will give you the current location