Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

progress bar - Android Google maps APIv2 InfoWindow and Markers


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?

UPD.

Spinner doen't spin cause of

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As stated at Google Maps Android API v2 Documentation:

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...