将GIF图片添加到Google Map Api v2的标记中 [英] Add GIF image to marker of Google Map Api v2

查看:153
本文介绍了将GIF图片添加到Google Map Api v2的标记中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将GIF图片添加到Google Map V2的标记时,该图片会显示,但会停止移动. 为什么?我该如何解决这个问题并使图像移动呢?

When I add GIF Image to marker of google map V2 the image is shown but it stops its movement. Why? And how can I solve this issue and make the image do its movement?

希望任何人都可以帮助我. 预先感谢.

Hope anyone can help me. Thanks in advance.

推荐答案

google maps中的标记图标android api v2是静态图像,创建标记后就无法更改该图标.因此,如果您尝试使用GIF图像添加任何动画,则将不支持该动画,并且GIF中仅单个图像将显示为图标.

Marker Icon in google maps android api v2 is a static image and you cannot change the icon once you have created the marker. So if you are trying to include any animation using GIF images, it will not be supported and only a single image from the GIF will be shown as the icon.

实现更改标记图像的一种方法是在一定时间后以编程方式remove()标记,然后立即使用addMarker将标记添加为MarkerOptions()中的其他图像并保留其他属性,然后立即使用addMarker添加标记.

An option to achieve changing marker image is to programatically remove() the marker after a certain time and then immediately add the marker using addMarker with a different image set as icon in MarkerOptions() and retaining other properties.

这篇关于将GIF图片添加到Google Map Api v2的标记中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆