2

I've run across a couple of similar questions here regarding getting an animated MKOverlayView working property with decent performance (e.g., an animated radar overlay). However, while the answers have helped lead me in the right direction, I still don't fully grasp what I'm missing yet.

I've been trying to get this UIImageView method working, which simply adds an UIImageView as a subview of the MKOverlayView, then adds the necessary images in the animation sequence to its animationImages property. This doesn't seem to work for me as the UIImageView and its associated images are never rendered. I've even tried calling setNeedsDisplay on the overlay view which also doesn't help. In my instance, the images used in the animation have to be loaded from a remote server first and are updated fairly frequently.

There's also this method that suggests using cocos2D to setup an animated sprite, which I'd like to avoid if the above method with UIImageView works successfully.

I've been struggling with this for two days straight now, so there's likely something I'm totally missing? Do I need to use Core Graphics to do the drawing similar to how it's performed in the main drawMapRect:zoomScale:inContext: method (which I've also tried but didn't work)?

Community
  • 1
  • 1
u10int
  • 219
  • 2
  • 8
  • Was never able to get an animated MKOverlayView working efficiently without being choppy and having MKMapView automatically render its views into CATiledLayers. Therefore, I resorted to simply overlaying a UIImageView on top of the map view when animation is enabled and animating using [view startAnimating]. I scale and move the UIImageView whenever the map view moves so it's not really noticeable that it's not actually part of the map view. – u10int Mar 18 '12 at 14:21
  • Do you have any sample code you code share? – sridvijay Dec 28 '12 at 22:05

1 Answers1

0

Maybe you can try this. Subclass the MKCircleView and animate a UIImageView added on it with Core Animation. It works well with the map moving around and scale with the map zoom in and out.

http://yickhong-ios.blogspot.com/2012/04/animated-circle-on-mkmapview.html

yickhong
  • 66
  • 3