I want to animate the circle that I’m adding as an MKOverLay. I want it to drop from the top of the screen. How do I animate through the delegate method? Or is it in the addition of the overlay? Can anyone point me in the right direction? Thanks!
I have this in the mapView Delegate Method
-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay
{
if([overlay isKindOfClass:[MKCircle class]]) {
// Create the view for the radius overlay.
MKCircleView *circleView = [[MKCircleView alloc] initWithOverlay:overlay];
circleView.strokeColor = [UIColor whiteColor];
circleView.fillColor = [[UIColor blueColor] colorWithAlphaComponent:0.2];
return circleView;
}
return nil;
}
And I add overLays like so:
MKCircle *circle = [MKCircle circleWithCenterCoordinate:userCoord radius:200];
[mainMapView addOverlay:circle];
Let’s say you want to have a scale up + fade in animation, you might do this:
n.b.: I took a guess at how you might add these animations at the time your overlay is added to the map view, but I haven’t tested it. You will need to experiment. You might be able to just set them when the view is created.
update: I tested it, it seems to work.