I have a normal map in my iOS application, where the option "Show users location" is enabled - this means that I have my usual blue dot on the map showing my location information and accuracy. Callout is disabled in code.
But I also have custom MKAnnotationViews that are built around the map, all of which have custom callouts.
This works fine, but the problem is that when my location is on the MKAnnotationView location, the blue dot (MKUserLocation) intercepts the touch, so MKAnnotationView is not affected.
How to disable user interaction with a blue dot so that strokes are intercepted by MKAnnotationViews, rather than a blue dot?
This is what I am doing so far:
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation;
{
if (annotation == self.mapView.userLocation)
{
[self.mapView viewForAnnotation:annotation].canShowCallout = NO;
return [self.mapView viewForAnnotation:annotation];
} else {
...
}
}
source
share