Я решил проблему, создав таймер в своем контроллере. Каждый раз, когда срабатывает таймер, он вызывает метод setNeedsDisplay для моего пользовательского MKOverlayRenderer. В методе drawMapRect подкласса рендеринга у меня есть следующий код для обновления изображения на наложении:
-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context{
if (!weatherDataStore) //This is the store where I have my radar images
weatherDataStore = [WeatherDataStore sharedInstance];
UIImage *image = [weatherDataStore currentRadarImage];
if (!image || ![image isKindOfClass:[UIImage class]]) {
return;
}
CGImageRef imageReference = image.CGImage;
CGContextSetAlpha(context, 0.8);
MKMapRect theMapRect = [self.overlay boundingMapRect];
CGRect theRect = [self rectForMapRect:theMapRect];
CGContextScaleCTM(context, 1.0, -1.0);
CGContextTranslateCTM(context, 0.0, -theRect.size.height);
CGContextDrawImage(context, theRect, imageReference);
}