Dynamic contents in Maps V2 InfoWindow

后端 未结 4 778
陌清茗
陌清茗 2020-11-29 03:24

I want to show an InfoWindow on markers in a Maps V2 fragment. Thing is, I want to show BitMaps that are dynamically loaded from the web with Universal Image Downloader.

4条回答
  •  失恋的感觉
    2020-11-29 04:19

    You should be doing Marker.showInfoWindow() on marker that is currently showing info window when you receive model update.

    So you need to do 3 things:

    1. create model and not put all the downloading into InfoWindowAdapter
    2. save reference to Marker (call it markerShowingInfoWindow)
      from getInfoContents(Marker marker)
    3. when model notifies you of download complete call
    if (markerShowingInfoWindow != null && markerShowingInfoWindow.isInfoWindowShown()) {
        markerShowingInfoWindow.showInfoWindow();
    }
    

提交回复
热议问题