Android的谷歌地图APIv2信息窗口和标记标记、窗口、地图、信息

2023-09-05 03:21:48 作者:哪个二逼发明了考试?

我使用谷歌地图APIv2为Android。我实现了MapFragment,把标志,我需要,添加自定义信息窗口的标记。 问题是 - 我的 AsyncImages 在我的信息窗口并有进度有。事情是 - 进度不旋转,而且图像不会设置后,我从缓存中得到它。 AsyncImages没有很好地工作。我测试过它变成另一个类。 我已经与替换我的 AsyncImages 查看只是单一的进度 - 相同。它不旋转。 有什么建议么?

I'm using Google maps APIv2 for android. I've implemented MapFragment, put markers where I need, added custom InfoWindow for markers. The issue is - I have AsyncImages in my InfoWindow and have ProgressBar there. The thing is - ProgressBar doesn't spin, and Image doesn't set after I got it from cache. AsyncImages does work well. I've tested it into another class. I've replace my AsyncImages view with just single ProgressBar - the same. It doesn't spin. Any suggestions?

微调doen't自旋原因

Spinner doen't spin cause of

注:即得出的信息窗口是不是一个实时视图。该观点是   在当时却是呈现为(使用View.draw(画布))图像   返回。这意味着,任何后续更改视图不会   通过在地图上的信息窗口反映。要更新的信息窗口   以后(比如,后的图像加载),调用showInfoWindow()。   此外,信息窗口将不会尊重任何互动   典型的一个普通视图,如触摸或手势事件。然而,你   可以听一个普通的点击事件的整个信息窗口作为   在下面的部分中描述。

Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

所以,问题是 - 如何实现以最好的方式从网站/缓存AsyncImages在地图上? 创建视图阵列的地方相隔的的 getContentInfo()的方式,也可以创建监听像水木清华的 OnImageDownloaded 的?

So the question is - how to realize AsyncImages from web/cache on Maps in the best way? Create Views array somewhere apart of getContentInfo() method and also create listener smth like OnImageDownloaded?

推荐答案

正如在谷歌地图Android的API V2文档:

注:即得出的信息窗口是不是一个实时视图。该观点是   呈现为图像(使用 View.draw(画布))的时间,它是   返回。这意味着,任何后续更改视图不会   通过在地图上的信息窗口反映。要更新的信息窗口   以后(比如,后的图像加载),调用 showInfoWindow()。   此外,信息窗口将不会尊重任何互动   典型的一个普通视图,如触摸或手势事件。然而,你   可以听一个普通的点击事件的整个信息窗口作为   在下面的部分中描述。

Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

也许你应该尝试调用 showInfoWindow()再放在你的code。

Perhaps you should try to call showInfoWindow() somewhere again in your code.