【发布时间】:2016-03-18 06:24:56
【问题描述】:
我的团队想要制作一款类似于 Uber 的 iOS 应用,它可以跟踪 GPS 位置并收取费用。但是根据我的实验和实测,GPS定位点并不总是准确的,有时会有一些偏差。 (有时精度很低)。那么像优步一样可以做些什么呢? 谢谢!
_locationManager.activityType = CLActivityTypeAutomotiveNavigation;
_locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
_locationManager.distanceFilter = kCLDistanceFilterNone;
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations
{
CLLocation *location = [locations lastObject];
if (location)
{
//success, but there is some deviation sometimes.the accuracy is low sometimes
}
else
{
//error
}
}
【问题讨论】:
标签: ios objective-c gps