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?
4 answers
Simplemente llama a Marker.showInfoWindow();
. Véase https://developers.google.com/maps/documentation/android/marker#info_windows y https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker#showInfoWindow()
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();
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();
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:
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