移动图标上的Andr​​oid MapView类 [英] Moving icons on a Android MapView

查看:119
本文介绍了移动图标上的Andr​​oid MapView类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,显示移动在谷歌MapView类项目的位置的应用程序。我需要的方式,以便更新在重新present的产品(以及改变每两秒钟为已更新数据来在图标的面)。

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).

我目前有在扩展MapActivity应用程序的活动。在此我已经覆盖一个静态的叠加绘制地图和ItemizedOverlay绘制静态图标一些行。

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.

有一个draw()方法,声称要使用的动画叠加,而是覆盖它做我的动画仍然没有做任何事情有生命的。

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?

推荐答案

有两件事情,我心里有你的问题。

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

首先,你有没有考虑使用无效()上的MapView强制重绘?这是 可能不是最有效的解决方案,但它至少应该让你的东西,你可以从工作。

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.

其次,可以通过再次调用活动刷新在地图上的项目。下面是一个例如

Second, you can refresh the items on your map by calling the activity again. Here is an example.

这篇关于移动图标上的Andr​​oid MapView类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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