Google Android maps api v2 Mostrar el Título del Marcador Siempre


Tengo un google maps v2 en mi aplicación Android y algunos marcadores en ella. Cuando el usuario hace clic en uno de estos marcadores, aparece una ventana emergente de título. ¿Cómo puedo mostrar estos títulos siempre sin clic del usuario?

Author: Cœur, 2013-01-29

4 answers

 37
Author: Anthony,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-29 17:21:17

Algo así:

googleMap.addMarker(new MarkerOptions()
    .position(new LatLng(latitude, longitude))
    .title("Your position")).showInfoWindow();
 39
Author: José De la O,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-08 22:35:24

Puedes hacer esto:

Marker marker = mMap.addMarker(new MarkerOptions().position(currentPosition).title("Your text"));
marker.showInfoWindow();
 10
Author: Khalil_Java,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-02-23 04:27:27

Para mostrar títulos de marcadores en el mapa alrededor de los marcadores, ninguna de las soluciones que encontré en Internet funcionó para mí, así que me arremangé e hice esta biblioteca que resuelve este problema para mí, con suerte ayudará a otros también:

Https://github.com/androidseb/android-google-maps-floating-marker-titles

Aquí hay una vista previa de cómo funciona:

previo

 -1
Author: androidseb,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-12 18:18:26