Using an Animated Gif as Ground Overlays in G. Maps v2

隐身守侯 提交于 2019-12-04 00:07:45

As a solution, we have decomposed the GIF in multiple images and we are looping all the image list.

We are using the same code as above and everything is fine.

Using an ImageView + Glide as suggested below doesn't help at all as the Image will not move with the Map.

You can use open source library to display Gif image in a single imageview just add its dependency https://github.com/bumptech/glide

and Its easy to use this an example code

ImageView imageView = (ImageView) findViewById(R.id.imageView);
GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(imageView);
Glide.with(this).load(R.raw.sample_gif).into(imageViewTarget);

@waza_be currently ground overlay does not support animated gif. hopefully they will have it soon. it was possible with version 1 using ImageView and adding it to the map. but in version 2, they scrapped adding views to the map.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!