I am not able to see the Blue current location dot when I use custom annotations
- (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id<MKAnnotation> ) annotation {
MKAnnotationView *customAnnotationView=[[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil] autorelease];
UIImage *pinImage = [UIImage imageNamed:@"ann.png"];
[customAnnotationView setImage:pinImage];
customAnnotationView.canShowCallout = YES;
//UIImageView *leftIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ann.png"]];
//customAnnotationView.leftCalloutAccessoryView = leftIconView;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
customAnnotationView.rightCalloutAccessoryView = rightButton;
return customAnnotationView;
}
if (annotation == map.userLocation) {
return nil;
}
Add this.:d
I got the answer now. Just need to add the following lines to the above code at the end just before return customAnnotationView;
if (annotation == mapView.userLocation) {
NSLog(@"nil"); return nil; }
thanks :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With