Can we create flashing red/blue circle around user location in mapview in iPhone ?

Yes we can create with a simple UIView animation & few images.

1) Add the MapView

MKMapView *mapView = [[MKMapView alloc] initWithFrame:yourFrameFrame];

mapView.mapType = MKMapTypeStandard;

mapView.delegate = self;

[mapView setShowsUserLocation:YES];

[self.view addSubview:mapView];


2) In viewForAnnotation method
– (MKAnnotationView *)mapView:(MKMapView *)mapview viewForAnnotation: (id <MKAnnotation>)annotation


UIImage *anImage = nil;

UIImageView *overlayImage;

if (annotation == mapview.userLocation)


MKPinAnnotationView *customPinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@”annotation”] autorelease];

customPinView.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@”redLocation.png” ofType:nil]];

customPinView.animatesDrop = NO;

customPinView.canShowCallout = YES;


overlayImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”OverlayImage.png”]];

overlayImage.frame = CGRectMake(0, 0, 15, 15); = CGPointMake(,;

[customPinView addSubview:overlayImage];

// timer for animation

NSTimer *mapTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(createOverlayAnimation) userInfo:nil repeats:YES];



return customPinView;





overlayImage.transform = CGAffineTransformMakeScale(1,1);

[UIView beginAnimations:nil context:NULL];

[UIView setAnimationDuration:1.0];

overlayImage.transform = CGAffineTransformMakeScale(5,5);

overlayImage.alpha = 1.0;

[UIView commitAnimations];


Need more help?

Hi there, was your problem or query resolved? If not & need more assistance, please do reach out to us at, we'll be more than delighted to help. Nanostuffs has 7+ years of extensive Salesforce & iOS/Android experience.
Holler Box