Reputation: 2489
I have many pins on my map and I want to animate the callout for the most visible pin. How can I check to see if the CLLocationCoordinate2D of a pin is visible or closest to the center?
Upvotes: 2
Views: 335
Reputation: 92
This might solve ur query
MKMapPoint userPoint = MKMapPointForCoordinate(_mapView.userLocation.location.coordinate);
MKMapRect mapRect = _mapView.visibleMapRect;
BOOL inside = MKMapRectContainsPoint(mapRect, userPoint);
Upvotes: 3