Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a button to a marker's info window? [closed]

I would like to implement this in my app, but I have no idea of how to make the marker have a button, or how to have the OnMarkerClickListener tell me what part it clicked on.

As an example, here is the official Maps app, where the directions icon is a separate part/button and the right side shows reviews.

Example

like image 763
Gray Avatar asked Dec 04 '12 18:12

Gray


1 Answers

I assume you are using the new version of the Google Maps Android API

While you can set an info window to be an arbitrary view using GoogleMap.setInfoWindowAdapter(), the info window that is rendered on the map is not a live view. Instead, it is a snapshot of the view at the time the view was returned by the adapter. So, unfortunately there is currently no way to distinguish between click events on the info window.

like image 96
Anthony Avatar answered Oct 01 '22 19:10

Anthony