2

そこで、View Controller に UIMap を追加し、それを「mapView」参照にリンクしました。座標もマップ上で完全に機能します。ただし、地図を座標にズームすることはできません! 私は何を間違っていますか?

CLLocationCoordinate2D _coords = CLLocationCoordinate2DMake(lat, lon); //lat and lon are previously declared location values
MKCoordinateRegion adjustedRegion = [mapView regionThatFits:MKCoordinateRegionMakeWithDistance(_coords, 250, 250)];
[self.mapView setRegion:adjustedRegion animated:YES]; //I have tried this with and without the self
 self.mapView.delegate = self;  
MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
annotationPoint.coordinate = _coords;
annotationPoint.title = @"George's House";
[mapView addAnnotation:annotationPoint];
 [mapView selectAnnotation:annotationPoint animated:YES];
4

0 に答える 0