0
사라지고, 나는 매우 끝에 this 튜토리얼지도보기가 핀 위치를 표시하고 내가 전에지도 뷰를 사용한 적이
을 다음되었다, 내 시뮬레이터는 점을가하려면에서 가정되는 방법을 보여줍니다 위치에 있지만 그 다음 즉시 파란색 화면으로 바뀝니다.
블루 스크린은 여전히 Google지도에 있습니다 (하단에는 Google 로고가 표시됨).하지만 더 이상 표시하려고하지 않습니다.
- (void)viewDidLoad
{
HandbookAppDelegate *delegate = (HandbookAppDelegate *)[[UIApplication sharedApplication] delegate];
Rule *thisRule = [delegate.rules objectAtIndex:index.row];
self.title = thisRule.ruleNumber;
// Set some coordinates for our position (Buckingham Palace!)
CLLocationCoordinate2D location;
location.latitude = (double) 51.501468;
location.longitude = (double) -0.141596;
// Add the annotation to our map view
MapViewAnnotation *newAnnotation = [[MapViewAnnotation alloc] initWithTitle:@"Buckingham Palace" andCoordinate:location];
[self.map addAnnotation:newAnnotation];
[newAnnotation release];
}
- (void)mapView:(MKMapView *)mv didAddAnnotationViews:(NSArray *)views
{
MKAnnotationView *annotationView = [views objectAtIndex:0];
id <MKAnnotation> mp = [annotationView annotation];
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance([mp coordinate], 1500, 1500);
[mv setRegion:region animated:YES];
[mv selectAnnotation:mp animated:YES];
}