show info window on every marker at a time show info window on every marker at a time android android

show info window on every marker at a time


It is not possible to show more than one info window at a time. From the documentation:

An info window allows you to display information to the user when they tap on a marker. Only one info window is displayed at a time. If a user clicks on another marker, the current info window will be hidden and the new info window will be displayed.

You may want to take a look at bubble icons from the Google Maps Android API Utility Library.Bubble icons adds more powerful rendering options for the markers, but does not change their behaviour. It means that you still won't be able to show more than one info window at a time, but bubble icons will allow you to show more info on each marker:

Add a IconGenerator to display snippets of information on your markers. This utility provides a way of making your marker icons look a bit like info windows, in that the marker itself can contain text and other content. The advantage is that you can keep more than one marker open at the same time, whereas only one info window can be open at once. You can also style the markers, change the orientation of the marker and/or content, and change the marker's background image/nine-patch.

UPDATE: An example using bubble icons (take into account that you will need to add the Google Maps Android API utility library to your project following this instructions):

LatLng latLng = new LatLng(latitude, longitude);TextView text = new TextView(context);text.setText("Your text here");IconGenerator generator = new IconGenerator(context);generator.setBackground(context.getDrawable(R.drawable.bubble_mask));generator.setContentView(text);Bitmap icon = generator.makeIcon();MarkerOptions tp = new MarkerOptions().position(latLng).icon(BitmapDescriptorFactory.fromBitmap(icon));googleMap.addMarker(tp);