简体   繁体   English

在Google Maps API,Android上显示多个信息Windows

[英]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. 我运行一个循环每隔几秒钟,并希望显示标记infowindow上的google maps API ,如果时间已经过的总时间的运行,我的问题是,当一个infoWindow弹出,它必须关闭别人是因为我只得到由于出现在lastMarker之后,因此显示了bestMarker窗口。 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! 如果有人有办法使两个窗口同时保持打开状态,将不胜感激!

Well, Google Maps official doc says you can not display two/more infoWindows at a time. 好吧, Google Maps官方文档说您一次不能显示两个或多个infoWindows。

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. 我的解决方案是-创建您的标记(自定义视图),例如infoWindow设计。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM