NKMapView 显示标注,并放大到标注位置

- (IBAction)FindUs:(id)sender {

    self.UsMap.hidden = NO;

    CLLocationCoordinate2D coord;

    coord.latitude = 34.7993;

    coord.longitude = 113.6939;

    POI *poi = [[POI alloc]initWithCoords:coord];

   [UsMap addAnnotation:poi]; 

    

    MKCoordinateRegion theRegion = { {0.0, 0.0 }, { 0.0, 0.0 } };

    theRegion.center=coord;

    [UsMap setZoomEnabled:YES];

    [UsMap setScrollEnabled:YES];

    theRegion.span.longitudeDelta = 0.01f;

    theRegion.span.latitudeDelta = 0.01f;

    [UsMap setRegion:theRegion animated:YES];

}

posted @ 2012-12-06 15:30  废弃账号  阅读(125)  评论(0)    收藏  举报