我可以在iOS中获得GPS位置的准确性吗? [英] Can I get the accuracy of GPS location in iOS?

查看:101
本文介绍了我可以在iOS中获得GPS位置的准确性吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过Android开发者获得GPS位置的准确性。有没有一种方法可以在iOS中获得当前GPS位置的准确性?

I've seen Android developers get the accuracy of a GPS location. Is there a way that I can get the accuracy of my currenct GPS location in iOS?

我使用

I am using the code from this answer to get my location:

 locationManager = [[CLLocationManager alloc] init];
 locationManager.delegate = self;
 locationManager.distanceFilter = kCLDistanceFilterNone;
 locationManager.desiredAccuracy = kCLLocationAccuracyBest;
 [locationManager startUpdatingLocation];


 - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
     NSLog(@"OldLocation %f %f", oldLocation.coordinate.latitude, oldLocation.coordinate.longitude);
     NSLog(@"NewLocation %f %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
 }


推荐答案

CLLocation -horizo​​ntalAccuracy -verticalAccuracy 。大多数情况下,准确度是基于您用来获取位置的硬件的。

There are 2 properties on the CLLocation -horizontalAccuracy and -verticalAccuracy. Most of times the accuracy is based on the hardware that you are using to get the location

这篇关于我可以在iOS中获得GPS位置的准确性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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