现在的位置: 首页 > 综合 > 正文

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

2018年05月25日 ⁄ 综合 ⁄ 共 460字 ⁄ 字号 评论关闭

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

}

抱歉!评论已关闭.