【发布时间】:2015-04-08 17:10:22
【问题描述】:
我正在从当前天气雷达的 NOAA 获取 gif,我将其存储在 UIImage 中,然后将其绘制到 MKMapView,这是我正在使用的一些代码:
image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://radar.weather.gov/ridge/Conus/RadarImg/latest_radaronly.gif"]]];
MKMapRect theMapRect = [self.overlay boundingMapRect];
CGRect theRect = [self rectForMapRect:theMapRect];
@try {
UIGraphicsBeginImageContext(image.size);
UIGraphicsPushContext(ctx);
[image drawInRect:theRect];
UIGraphicsPopContext();
UIGraphicsEndImageContext();
}
@catch (NSException *exception) {
NSLog(@"Caught an exception while drawing radar on map - %@",[exception description]);
}
@finally {
}
有谁知道我可以如何反复制作此 gif 动画,以实现您在新闻中看到的类似雷达的天气。我找到了几个可以做到这一点的应用程序,我想知道如何将它整合到我自己的项目中。
【问题讨论】:
标签: ios objective-c mkmapview mkoverlay