【发布时间】:2014-07-02 10:13:34
【问题描述】:
当用户单击标记时,我正在尝试从自定义 infoWindow 中的 URL 加载图像。我能够加载其他细节,但图像没有加载它。我正在使用毕加索图书馆为我做这件事。我搜索了许多相关主题并查看了解决方案,但无法理解应用哪种解决方案来解决我的问题。我正在使用 Web 服务调用来获取所需的数据。
这是我的代码:
@Override
public View getInfoContents(Marker arg0) {
//marker.showInfoWindow();
return null;
}
@Override
public View getInfoWindow(Marker arg0)
{
View v = getLayoutInflater().inflate(R.layout.map_infowindow, null);
for(int i=0 ; i<lstMain.size();i++)
{
Pojo b=lstMain.get(i);
double slat= Double.parseDouble(b.getLatitude());
double slng= Double.parseDouble(b.getLongitude());
double lat= Math.round(slat*100000.0)/100000.0;
double lng= Math.round(slng*100000.0)/100000.0;
String s1=String.valueOf(lat);
String s2=String.valueOf(lng);
Log.v("comparing latilongi pojo===>", lat+" , "+lng);
Log.v("comparing latilongi marker===>", Clickedlatitude+" , "+Clickedlongitude);
if(s1.equals(String.valueOf(Clickedlatitude)) && s2.equals(String.valueOf(Clickedlongitude)))
{
txtDname=(TextView)v.findViewById(R.id.infoDoctorName);
txtDspe=(TextView)v.findViewById(R.id.infoDoctorSpe);
txtDaddress=(TextView)v.findViewById(R.id.infoDoctorAddress);
imgUrl=(ImageView)v.findViewById(R.id.infoDoctorImage);
String url=b.getPhotoURL();
txtDname.setText(b.getDoctorName());
txtDspe.setText(b.getSpecialization());
txtDaddress.setText(b.getAddress1()+" , "+b.getAddress2());
Picasso.with(MapActivity.this)
.load(url)
.placeholder(R.drawable.ic_launcher)
.error(R.drawable.ic_launcher).resize(50, 50)
.into(imgUrl);
}
}
return v;
}
我已经看到了这些解决方案,但不知道究竟什么可以解决我的问题:
Why Custom InfoWindow of google map v2 ,Not load url Image?
【问题讨论】:
-
从这里尝试更喜欢 AndroidQuery :code.google.com/p/android-query
-
@Haresh 你能再解释一下吗,这样我就可以理解 AndroidQuery 是什么以及如何使用它以及它如何帮助解决我的问题
-
我也在使用非常好的第三方图像加载库来管理加载任务,并且您建议的库也用于相同目的。我的问题是其他的。
标签: android android-maps