텐센트 맵은 여러 InfoWindow 문제를 보여줍니다.
1296 단어 텐센트 지도
아래 위 코드:
public class Bean {
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
List data = new ArrayList<>();
/**
* Marker
*/
for (int i = 0; i < data.size(); i++) {
Bean bean =data.get(i);
//
LatLng latLng = new LatLng(latitude, longitude);
final Marker marker = tencentMap.addMarker(new MarkerOptions());// marker
marker.setPosition(latLng);//
marker.setTag(i);
// icon , fromView
marker.setIcon(BitmapDescriptorFactory.fromView(getCustomerView(Bean, size)));
marker.setAnchor(0.5f, 1f);//
}
/**
*
*/
public View getCustomerView(Bean bean,int size) {
View view = View.inflate(getContext(), R.layout.layout_marker, null);
TextView tv1 = (TextView) view.findViewById(R.id.tv_1);
ImageView ivLocation = (ImageView) view.findViewById(R.id.iv_location);
tv1.setText(bean.getContent());
ivLocation.setImageResource(R.drawable.main_map_location1);
return view;
}