简体   繁体   English

CLLocationmanager中的GPS位置更新

[英]GPS location updates in CLLocationmanager

我正在开发一个应用程序。我正在使用CLLocation Manager获取位置更新。我知道当我调用开始位置更新方法gps时关闭,而当我们调用停止位置更新gps时关闭。但是我想关闭GPS,我仍然想使用手机信号塔或wifi.wifi来获取位置更新。

You can use the desiredAccuracy property of CLLocationManager to tell the system how accurate the location needs to be. 您可以使用CLLocationManagerdesiredAccuracy属性来告诉系统位置的精确度。 You don't have control over whether GPS gets turned on or not, but setting the desiredAccuracy to a lower accuracy consumes less power. 您无法控制是否打开GPS,但是将desiredAccuracy精度设置为较低的精度会消耗较少的功率。

From the CLLocationManager Class Reference : CLLocationManager类参考

The receiver does its best to achieve the requested accuracy; 接收机尽最大努力达到要求的精度; however, the actual accuracy is not guaranteed. 但是,不能保证实际的准确性。

You should assign a value to this property that is appropriate for your usage scenario. 您应该为此属性分配一个适合您的使用情况的值。 In other words, if you need the current location only within a few kilometers, you should not specify kCLLocationAccuracyBest for the accuracy. 换句话说,如果您仅需要几公里之内的当前位置,则不应为准确度指定kCLLocationAccuracyBest。 Determining a location with greater accuracy requires more time and more power. 确定精度更高的位置需要更多的时间和更多的功率。

When requesting high-accuracy location data, the initial event delivered by the location service may not have the accuracy you requested. 当请求高精度位置数据时,位置服务传递的初始事件可能不具有您要求的准确性。 The location service delivers the initial event as quickly as possible. 定位服务会尽快传递初始事件。 It then continues to determine the location with the accuracy you requested and delivers additional events, as necessary, when that data is available. 然后,它将继续以您要求的精度确定位置,并在有可用数据时根据需要提供其他事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果关闭位置服务,CLLocationManager永远不会更新 - If location services is turned off, CLLocationManager never updates 当用户选择位置按钮时,CLLocationManager更新位置 - CLLocationManager updates location when user select location button 核心位置,是否可以在没有GPS芯片供CLLocationManager类使用的情况下向iPad提供GPS /位置日期? - Core Location, is it possible to supply GPS/Location date to an iPad without the GPS chip for use within the CLLocationManager class? iPhone GPS - 未收到有效的位置更新 - iPhone GPS - Not receiving valid location updates 在Mapkit中检查用户位置年龄-MapKit用户位置的GPS精度明显优于CLLocationManager? - Check user location age in Mapkit - GPS accuracy for MapKit User Location significantly better than from CLLocationManager? iOS的后台位置更新始终显示GPS图标 - Background location updates for iOS display GPS icon the entire time 当应用程序在后台运行时,iOS 4使用GPS进行定期位置更新 - iOS 4 periodic location updates using GPS while app is in background 单独的CLLocationManager用于位置和方向吗? - Separate CLLocationManager for location & heading? 如何在CLLocationManager中更新位置 - How to update location in CLLocationManager CLLocationManager 提供旧位置 - CLLocationManager is giving old location
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM