[英]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. 您可以使用
CLLocationManager
的desiredAccuracy
属性来告诉系统位置的精确度。 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.