这是我将地图重新定位到 iOS 中用户位置的代码。此方法工作正常,但我遇到的问题是在用户的当前位置放置一个地标。我是使用地标的新手,如果有人帮助我,我将不胜感激。
- (IBAction)recenterMapToUserLocation:(id)sender {
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = 0.02;
span.longitudeDelta = 0.02;
region.span = span;
region.center = self.mapView.userLocation.coordinate;
[self.mapView setRegion:region animated:YES];
}