I am able to set annotations within some specified KM radius of the user current location (lets say for annotations are indicating pizza search points). But if the user drags the map left/right/top/bottom then is there any way to refresh the map and add annotations for new pizza locations in the new visible area of the map? Please suggest.
Asked
Active
Viewed 54 times
-2
-
You should use [MKMapViewDelegate](https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapViewDelegate_Protocol/index.html). It has methods that signals a change visible area **mapView:regionWillChangeAnimated:** and **mapView:regionDidChangeAnimated:** – Brain89 Jan 28 '15 at 13:01
1 Answers
0
Try with using following Method
- (void)mapView:(MKMapView *)mapView
annotationView:(MKAnnotationView *)annotationView
didChangeDragState:(MKAnnotationViewDragState)newState
fromOldState:(MKAnnotationViewDragState)oldState
{
if (newState == MKAnnotationViewDragStateEnding)
{
CLLocationCoordinate2D droppedAt = annotationView.annotation.coordinate;
NSLog(@"Pin dropped at %f,%f", droppedAt.latitude, droppedAt.longitude);
}
}

Abhishek Sharma
- 3,283
- 1
- 13
- 22