Google maps - Moving icons on a Android MapView

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I m working on an application that displays the location of moving items on a Google MapView. I need a way to update the position of the icons that represent the items (as well as change the facing of the icons every two seconds as updated data comes in).

I currently have an activity in the app that extends MapActivity. On to this I have overlaid a static Overlay that draws some lines on the map and an ItemizedOverlay that draws a static icon.

There is a draw() method that claims to be used by animated overlays, but overriding it to do my animations still doesn t make anything animate.

Do I need to tell the app to make my overlay animate, or do I need to use a different type of overlay?

Answers

There are two things that I have in mind about your problem.

First, did you consider using invalidate() on the MapView to force a redraw? That s probably not the most efficient solution, but it should at least get you something you can work from.

http://www.jameselsey.co.uk/blogs/techblog/android-using-intents-to-refresh-tab-content/ http://www.jameselsey.co.uk/blogs/techblog/android-using-intents-to-refresh-tab-content/

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/3795834/moving-icons-on-a-android-mapview

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils