谷歌地图版本2 - 更新信息的窗口 [英] Google Maps Version 2 - Updating information windows

查看:179
本文介绍了谷歌地图版本2 - 更新信息的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道在谷歌地图机器人版本2中,定制的信息的窗口,是转换为图像的图。其实谷歌aftre返回您查看视图转换为图像的再出示给信息窗口。

As we know in google maps android version 2, a custom information windows, is a view that converts to an image. Actually google aftre you return you view converts the view to a image an then show it to the info windows.

但我想说明下载从互联网到我的信息窗口的图像。其实,我想,在此之前下载完整展现一个进度条到我的信息窗口,并在其后compeleted更新信息窗口,通过这个机制我该怎么办呢?

But I want to show images downloading from internet to my infowindow. Actually, I want that before that download complete show an progress bar to my infowindows and after it compeleted update info windows, by this mechanism how I can do this?

推荐答案


  • 有一个包含INT进步和位图实际图像模型对象。

  • 启动某种开始后台操作(如的AsyncTask )至下载图片。

  • AsyncTask.onProgressUpdate
  • 更新模式的进步
  • 更新模型从 AsyncTask.onPostExecute
  • 图片
  • 有模型观察者(见观察partern )。

  • 如果您保持的AsyncTask (或活动的任何其他类型的情况下,不要忘了取消它,你也可以跳过观察者模式。

  • 保存参考标记内 InfoWindowAdapter.getInfoWindow 显示信息窗口。说它 markerShowingInfoWindow

  • 当您收到通知进度更新,

  • Have a model object that contains int for progress and Bitmap for actual image.
  • Start some kind of background operation started (e.g. AsyncTask) to download image.
  • Update model's progress from AsyncTask.onProgressUpdate.
  • Update model's image from AsyncTask.onPostExecute.
  • Have an observer for model (see Observer partern).
  • If you keep AsyncTask (or any other kind of Thread in Activity context, don't forget to cancel it and you may also skip observer pattern.
  • Save reference to marker showing info window inside InfoWindowAdapter.getInfoWindow. Call it markerShowingInfoWindow.
  • When you are notified of progress update,
  • 电话:

    if (markerShowingInfoWindow != null && markerShowingInfoWindow.isShowingInfoWindow()) {
        markerShowingInfoWindow.showInfoWindow();
    }
    

    要强制 InfoWindowAdapter.getInfoWindow 呼叫并创建的ViewGroup 包含进度的ImageView

    To force InfoWindowAdapter.getInfoWindow call and create ViewGroup containing ProgressBar and ImageView from progress and image values inside model.

    像往常一样,翻译成C#世界这一点。

    As always, translate this into C# world.

    这篇关于谷歌地图版本2 - 更新信息的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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