I\'m coding a map view with around 900 annotations. Having this many annotations on a map make the performance suffer, so I\'d like to reduce it to about 300 at a time. The
Here's a code snippet that takes an MKAnnotation's coordinates, convert it to a CGPoint relative to the MKMapView, and logs what's the underlying view at that CGPoint.
CGPoint pinPoint = [mapView convertCoordinate:pinView.annotation.coordinate toPointToView:mapView];
NSLog(@"pointing to %@", [[mapView hitTest:pinPoint withEvent:nil] description]);
Put that inside a loop that iterates through all your pins. If the underlying view is another MKAnnotation instance, then hide that pin.
if([[mapView hitTest:pinPoint withEvent:nil] isKindOfClass:[FFMapPinView class]])
pinView.hidden = YES;
For this to work properly, you need the pinsArray to be ordered so that index 0 is the frontmost pin.