4

I am working on android tracking application.

I need to show Connected friends on MapView. Each Friends marker contains image(Person image) and two buttons(Make Call and message) .

Note : The two buttons should show after image pressed.

I try this sample http://www.nasc.fr/android/android-using-layout-as-custom-marker-on-google-map-api/. It shows only TextView.

Is there any way to add custom marker with button or any other ideas to achieve this?

Below image shows the map-view that i want to add live views.

Thanks in Advance

enter image description here

Community
  • 1
  • 1
AndHobbiest
  • 131
  • 1
  • 1
  • 8

3 Answers3

6

If I'm not wrong, you're looking for infowindowadapter. Did you try infowindowadapter ? If not please implement it .

Here is the link

Visit Here

Thanks. Let me know if it helps.

TheLittleNaruto
  • 8,325
  • 4
  • 54
  • 73
4

Finally i ended up with my result with the below link

Google Maps Android API v2 - Interactive InfoWindow (like in original android google maps)

Its quiet interesting to hack layouts.

Thanks,

Community
  • 1
  • 1
AndHobbiest
  • 131
  • 1
  • 1
  • 8
1

From the Google Maps V2 documentation:

Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (e.g., after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.

Therefore, you can't add buttons to the markers. An idea could be have that buttons somewhere in your layout and show/hide them when the user selects a marker.

evaristokbza
  • 812
  • 3
  • 12
  • 24