如何在iphone中获得重要位置更新的准确性?

时间:2021-01-28 14:57:58

How can one know of the accuracy level of the significant location update in iphone?? As the standard location, one can set the accuracy level depending upon the parameters that can be set, but whereas the significant location accuracy cannot be set for accuracy but how to read the accuracy of the received location update?

如何才能知道iphone中重要位置更新的准确度?作为标准位置,可以根据可以设置的参数设置精度级别,但是不能设置显着的位置精度以获得准确性,而是如何读取接收位置更新的准确性?

1 个解决方案

#1


1  

The class CLLocationManager has an accuracy parameter, called desiredAccuracy which is of the class CLLocationAccuracy. But hold up! Its not a class, its a typedef double so here are the constants

类CLLocationManager有一个名为desiredAccuracy的精度参数,它是CLLocationAccuracy类。但是抱起来!它不是一个类,它是一个typedef double,所以这里是常量

extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
extern const CLLocationAccuracy kCLLocationAccuracyBest;
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;

What I suggest you do is assign your location manager's accuracy to a new variable it and compare it like the following:

我建议你做的是将你的位置经理的准确性分配给一个新变量,并将其与下面进行比较:

CLLocationAccuracy locationAccuracy = self.locationManager.desiredAccuracy;

if (locationAccuracy == kCLLocationAccuracyBest) {

    NSLog(@"It is the kCLLocationAccuracyBest my life is complete!");
}
else if (/*other comparisons stuff here*/) {

}

Also, you have to import:

此外,您必须导入:

#import <CoreLocation/CLLocation.h>

Rohan

罗汉

#1


1  

The class CLLocationManager has an accuracy parameter, called desiredAccuracy which is of the class CLLocationAccuracy. But hold up! Its not a class, its a typedef double so here are the constants

类CLLocationManager有一个名为desiredAccuracy的精度参数,它是CLLocationAccuracy类。但是抱起来!它不是一个类,它是一个typedef double,所以这里是常量

extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0);
extern const CLLocationAccuracy kCLLocationAccuracyBest;
extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters;
extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters;
extern const CLLocationAccuracy kCLLocationAccuracyKilometer;
extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers;

What I suggest you do is assign your location manager's accuracy to a new variable it and compare it like the following:

我建议你做的是将你的位置经理的准确性分配给一个新变量,并将其与下面进行比较:

CLLocationAccuracy locationAccuracy = self.locationManager.desiredAccuracy;

if (locationAccuracy == kCLLocationAccuracyBest) {

    NSLog(@"It is the kCLLocationAccuracyBest my life is complete!");
}
else if (/*other comparisons stuff here*/) {

}

Also, you have to import:

此外,您必须导入:

#import <CoreLocation/CLLocation.h>

Rohan

罗汉