使用纬度和经度我想通过注释显示正确的位置。我的应用程序显示了该区域,但没有通过注释显示正确的位置。
这是我的代码:
-(void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.mapView.delegate=self;
[self.mapView setShowsUserLocation:YES];
locatinmanager=[[CLLocationManager alloc]init];
[locatinmanager setDelegate:self];
[locatinmanager setDistanceFilter:kCLDistanceFilterNone];
[locatinmanager setDesiredAccuracy:kCLLocationAccuracyBest];
}
#pragma mark - MKMapViewDelegate methods.
- (void)mapView:(MKMapView *)mapView didAddAnnotationViews:(NSArray *)views {
MKCoordinateRegion region;
region.center.latitude=13.0839;
region.center.longitude=80.2700;
[mapView setRegion:region animated:YES];
}
答案 0 :(得分:0)
您已为地图设置了区域,但未设置注释。
对于蓝点,您需要为相同的纬度和逻辑添加注释。 添加以下代码。
MapPoint *mp = [[MapPoint alloc] initWithCoordinate:**YouReagionsCordinat** title:@"**yourLocation**"];
[mapView addAnnotation:mp];
如果你仍然坚持,那么请通过This tutorial