【发布时间】:2014-07-12 06:48:13
【问题描述】:
我一直在努力为步行、骑自行车和驾车实施路线追踪地图。
但是,正如您在以下屏幕截图中看到的那样,即使我没有步行/骑自行车或开车到那个位置,我的坐标也会不时突然跳跃。已在图像上绘制圆圈以指出问题。我的问题是为什么突然坐标跳跃?
这是我的实现快照:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
CoordinateModel *coord = [[CoordinateModel alloc] init];
coord.latitude = newLocation.coordinate.latitude;
coord.longitude = newLocation.coordinate.longitude;
ActivityType currentActivityType = [DataManager sharedInstance].activityType;
if (currentActivityType == 0) {
// walking
[appDelegate.walkingCoordinates addObject:coord];
}
else if(currentActivityType == 1) {
[appDelegate.bikingCoordinates addObject:coord];
}
else if(currentActivityType == 2) {
// driving
[appDelegate.drivingCoordinates addObject:coord];
}
self.coordinate = newLocation.coordinate;
}
【问题讨论】:
-
这里有问题吗?我没有看到问号。
-
对不起,迈克尔。我添加了问题。我的问题是为什么突然坐标跳跃?
标签: ios objective-c xcode core-location cllocationmanager