我得到了带有一些标记的谷歌地图,但所有标记都有羞耻信息如何为不同的标记制作不同的信息?
for (Station station : stationsListResponse.data.stations) {
final Station st = station;
map.addMarker(new MarkerOptions().position(new LatLng(station.getLatitude(), station.getLongitude())));
map.setInfoWindowAdapter(new InfoWindowAdapter() {
@Override
public View getInfoWindow(Marker arg0) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
View v = getLayoutInflater().inflate(R.layout.info_window, null);
TextView info= (TextView) v.findViewById(R.id.info);
info.setText(st.street+"\n"+st.city);
return v;
}
});
}