开发者

It is possible to put a animate image on a item of a googlemap? (like a gif)

i have an android app with a googlemap view

i have to put an animated icon representing a gps position on the map

i know how to do it with a normal png image, but i want to use something like a GIF image, an animated image

how i can to do it?

EDIT:

THIS IS THE XML ANIMATED: animation.xml

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
<item android:drawable="@drawable/miniicon" android:duration="200" />
<item android:drawable="@drawable/miniicon2" android:duration="200" />
<item android:drawable="@drawable/star" android:duration="200" />
</animation-list>

this is where i asign the XML animated to the drawable

//drawable2 = this.getResources().getDrawable(R.drawable.miniicon2); // Icono del programa, para mi posicion GPS
drawable2 = this.getResources().getDrawable(R.layout.animation); // I开发者_高级运维cono del programa, para mi posicion GPS


Another answer - there's a similar (but old) question on stackoverflow:

Image series (animation) over Google Maps

which if you look at the accepted answer, provides a demo link. Some other interesting comments as well.


You need to use an animation-list its just a simple xml file that you drop in the drawable folder. Here is an example, this is the download icon in the notification bar is done.


For sure - OpenGL allows 2D images to be overlayed on top of the image, for one way to do it. Have a look at Does Google MapView in Android use OpenGL? for a similar question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜