Edited to add * I have not yet found a solution for this, can anyone help? My problem is similar to this, but the answer you sent does not work for me - Update MKMapView after moving the cursor * End Edit
I have a map display with search support. When a user clicks on a search, my user annotations are added to the map view. A search returns 20 results with a “download more” link. When I click more downloads, more annotations should be added to the map view.
Problem - Annotations are added to the map view, but not displayed on the map. If I zoomed in or zoomed out to change the area of the map, contacts will be shown.
I find viewForAnnotations: does not receive a call when I click "load more". I am not sure how to trigger this. any?
-(void)completedSearch:(NSNotification *)resultNotification
{
customAnnotation *annot = [[customAnnotation alloc] initWithCoordinate:coordinate];
[annotationsArray addObject:annot];
[mView addAnnotations:annotationsArray];
[mView setRegion:region animated:YES];
[mView regionThatFits:region];
}
@interface customAnnotation : NSObject <MKAnnotation>
{
CLLocationCoordinate2D coordinate;
NSString* title;
NSString* info;
}
@property (nonatomic, retain) NSSting *title;
@property (nonatomic, retain) NSSting *info;
-(id) initWithCoordinate:(CLLocationCoordinate2D)c;
@end
@implementation customAnnotation
@synthesize coordinate, title, info;
-(id) initWithCoordinate:(CLLocationCoordinate2D)c
{
coordinate = c;
return self;
}
-(void)dealloc{
@end
source
share