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

来源:互联网 发布:网络编辑任职要求 编辑:程序博客网 时间:2024/06/05 14:27

- (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];

}

原创粉丝点击