Ich bin mit Google Maps Api und möge ein Bild innerhalb Infofenster zeigen, wenn eine Markierung klicken. Ich habe es implementiert, aber es gibt ein Problem mit Picasso. Wenn ich auf einen Marker klicke, wird infoWindow angezeigt und imageView zeigt ein Platzhalterbild an. Wenn ich denselben Marker noch einmal anklicke, lädt Picasso das Bild erfolgreich. Ich muss zweimal klicken, es ist so komisch.Picasso Bild Lade Ausgabe in GoogleMap.InfoWindowAdapter
Screenshots zum besseren Verständnis:
Klicken Sie zuerst auf den Marker:
Wenn ich noch einmal auf:
Es ist mein Codes unter:
InfoWindowAdapter (Picasso Laden hier)
mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker marker) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
View myContentsView = getLayoutInflater().inflate(R.layout.map_info_content, null);
ImageView imageView = (ImageView) myContentsView.findViewById(R.id.imgView_map_info_content);
Picasso.with(MainActivity.this)
.load(marker.getSnippet())
.placeholder(R.drawable.ic_placeholder)
.into(imageView);
return myContentsView;
}
});
das Setzen von Markern (Snippet mit Bild-URL zu übergeben)
for (MediaFeedData item : mItemList) {
LatLng position = new LatLng(item.getLocation().getLatitude(),
item.getLocation().getLongitude());
mMap.addMarker(new MarkerOptions()
.snippet(item.getImages().getLowResolution().getImageUrl())
.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_point))
.position(position));
}
Infowindow Layout xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/imgView_map_info_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
ein ähnliches Problem (Stoff für Twitter - Picasso), keine Lösung http://stackoverflow.com/questions/32715198/fabric-twitter- do-not-download-pictures-of-tweet –
Es geht also nicht um Picasso. InfoWindowAdapter funktioniert nicht richtig – sembozdemir