Nathan May
Nathan May

Reputation: 33

Show multiple infoWindows on google maps api, android

I am a beginner trying to code a running app and have run into a problem. I am running a loop every few seconds and want to display a markers infowindow on google maps API if the time has passed the total time for those runs, my problem is when one infoWindow pops up, it must close the others because I only ever get the bestMarker window to show up since it comes after lastMarker. Here is my code -

if (getCount() >= lastDone) {
  lastMarker.setTitle("Done!");
  lastMarker.showInfoWindow();
 }
 if (getCount() >= bestDone) {
  bestMarker.showInfoWindow();
  bestMarker.showInfoWindow();
 }

If anyone has a solution to make both windows stay open at the same time it would be greatly appreciated!

Upvotes: 1

Views: 3268

Answers (1)

Bharatesh
Bharatesh

Reputation: 9009

Well, Google Maps official doc says you can not display two/more infoWindows at a time.

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

My Solution will be - create your Markers (custom view) like infoWindow design.

Upvotes: 2

Related Questions