我使用geocode.And我尝试设置animate:YES到处都没有用。
这是我的代码
@ map.m
mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
mapView.delegate = self;
mapView.mapType = MKMapTypeStandard;
CLLocationCoordinate2D coord = {latitude: lat, longitude : lon};
MKCoordinateSpan span = {latitudeDelta: 0.001, longitudeDelta: 0.001};
MKCoordinateRegion region = {coord, span};
[mapView setRegion:region animated:YES];
[self.view addSubview:mapView];
MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coord];
[geocoder setDelegate:self];
[geocoder start];
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
mapPlacemark=placemark;
[mapView addAnnotation:placemark];
}
请帮助我或指导我。非常感谢 。 。 。
谢谢你的回答。这是代码的重复
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
mapPlacemark=placemark;
[mapView selectAnnotation:placemark animated:YES]; //Use this code.
//[mapView addAnnotation:placemark]; << Don't use this code
}
答案 0 :(得分:2)