Without getting into OpenGL (Quartz 2D is OK):
-
Let’s say I have an image which I want to move across a map in some fluid way. For instance, an image of a plane “flying” across the map. I’ve been able to do this using an MKAnnotation, an NSTimer and fiddling with the rate of lat/lon change and timer rate. However, I assume this isn’t ideal, although the results look pretty decent. Can you think of a better way?
-
Now let’s say that I want this image to be animated (think: animated gif). I can’t do the usual
UIImageViewwith a series ofanimationFramesbecause all I have access to in MKAnnotationView is aUIImage. How would you guys tackle this?
I realize that #2 could be handled with a UIImageView on top of the map containing the animationImages. However, then I would have to manually handle translating the movement of the plane or rocket or whatever as the region of the mapview changed, depending on user movements in the real-world, or user zooming (scrolling is not allowed in my app).
What do you think?
I think I’ve figured out a solution to #2. I subclassed MKAnnotationView and wrote some code to add a UIImageView (with animation images) as a subview.
//AnimatedAnnotation.m