1

我正在做地图应用程序。我在地图上显示注释针。在针上点击针附件按钮时有附件按钮,它导航到针详细信息页面。详细页面有一个删除按钮删除地点。删除后我我弹出到地图视图引脚显示在地图上。但是我的对象数组减少了 1。但是引脚显示与以前一样如何解决它。我的要求是当用户弹出到地图视图时删除该引脚不会显示在地图上查看。请帮助我.....

4

1 回答 1

0

首先尝试此方法,只需在删除注释时调用此方法..

-(void) reloadMap
{
    [yourMapView setRegion:yourMapView.region animated:TRUE];
}

选项

否则只需删除所有注释并使用您的数组对象再次添加..删除这样的注释

 MKCoordinateRegion region;
 MKCoordinateSpan span;
 span.latitudeDelta=0.04;
 span.longitudeDelta=0.04;

region.span=span;  
region.center = currentLocation; 
[MymapView removeAnnotations:[MymapView annotations]];
MyAnnotation *ann = [[MyAnnotation alloc] init]; ///This is My Annotation class which i create for display detail of location
ann.title =MymapView.userLocation.title;  
ann.subtitle = MymapView.userLocation.subtitle;
ann.coordinate = currentLocation;
ann.annLocation=[NSString stringWithFormat:@"%f%f",currentLocation.longitude,currentLocation.latitude];
[MymapView addAnnotation:ann];

[MymapView setRegion:region animated:TRUE];
[MymapView regionThatFits:region];
于 2012-11-29T11:46:31.153 回答