How do I test if a CLLocationCoordinate2D is visible in the current MKMapView?
I have many pins on my map and I want to animate the callout for the most visible pin. How开发者_JAVA技巧 can I check to see if the CLLocationCoordinate2D of a pin is visible or closest to the center?
This might solve ur query
MKMapPoint userPoint = MKMapPointForCoordinate(_mapView.userLocation.location.coordinate);
MKMapRect mapRect = _mapView.visibleMapRect;
BOOL inside = MKMapRectContainsPoint(mapRect, userPoint);
精彩评论