我在地图上添加了多个标记。我想在地图上添加标记时显示所有标记信息面板,但只能显示最后的标记信息。这是我的代码:
/*Place all stores on map*/
private void placeMarkersOnMap() {
for (int i = 0; i < store_list.size(); i++) {
double latitude = Double.parseDouble(store_list.get(i).latitude.toString());
double longitude = Double.parseDouble(store_list.get(i).longitude.toString());
String title = store_list.get(i).id + " " + store_list.get(i).store_name.toString();
String snipet = store_list.get(i).address + " ," + store_list.get(i).working_hours;
Marker marker = map.addMarker(new MarkerOptions().position(
new LatLng(latitude, longitude))
.title(title)
.snippet(snipet).icon(BitmapDescriptorFactory.fromResource(map_marker)));
marker.showInfoWindow();
map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 14));
}
}