动画的MKOverlayView [英] Animating an MKOverlayView

查看:217
本文介绍了动画的MKOverlayView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示动画的雷达数据作为一系列图像的MKOverlayView。我的问题是,该雷达图像被切碎成MapKit砖。要切换图像我有一个调用它设置在我的叠加当前图像的更新功能,然后调用一个计时器以下

I have an MKOverlayView that displays animated radar data as a series of images. The issue I have is that the radar images are chopped into tiles by MapKit. To swap images I have a timer that calls an update function which sets the current image in my overlay and then calls the following

[myRadarOverlayView setNeedsDisplayInMapRect:self.mapView.visibleMapRect];

该覆盖更新,但这样做一次一个瓦,所以我得到一个波涛汹涌的动画。如何使所有的瓷砖在精确的同时动画(即交换图像)任何想法?

The overlay updates, but does so one tile at a time so I get a choppy animation. Any ideas about how make all the tiles animate (i.e. swap images) at the exact same time?

推荐答案

我加入一个UIImageView作为MKOverlayView的子视图解决了这个。

I solved this by adding a UIImageView as a subview of the MKOverlayView.


  • 要动画,停止与绘图
    正常
    drawMa preCT:zoomScale:inContext的:(通过
    实例变量/属性标志)和
    画到的UIImageView,而不是(以
    所述animationImages属性),则
    使用startAnimating。

  • To animate, stop drawing with the normal drawMapRect:zoomScale:inContext: (via an instance variable/property flag) and draw to the UIImageView instead (to the animationImages property), then use startAnimating.

您可以处理平移和缩放通过
重新初始化中的UIImageView
响应
图形页面:regionDidChangeAnimated:

You can handle panning and zooming by reinitializing the UIImageView in response to mapView:regionDidChangeAnimated:.

这篇关于动画的MKOverlayView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆