【发布时间】:2014-03-03 03:30:31
【问题描述】:
我有一个MKMapView,我在其中设置了:
[self.mapView setShowsUserLocation:YES];
我想显示用户的位置,并在他/她移动时更新位置。当didUpdateUserLocation 被调用时,地图似乎会重新定位到用户的位置,即使用户已经平移了应用程序以查看另一个区域。我想要的是能够跟踪用户的位置,同时也让用户探索地图。我的didUpdateUserLocation 目前看起来像这样:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
_currentLocation = userLocation;
[self.mapView setRegion:MKCoordinateRegionMake(CLLocationCoordinate2DMake(self.currentLocation.coordinate.latitude + 0.0015, self.currentLocation.coordinate.longitude), MKCoordinateSpanMake(0.01, 0.01)) animated:NO];
[...]
}
关于我应该做什么来实现我想要的任何想法?
【问题讨论】:
标签: ios objective-c mkmapview core-location