Android: custom button marker with buttons in the Google Maps API 2

I am working on an Android tracking app.

I need to show Connected to friends in MapView. Each "Friends" contains an image (face image) and two buttons ("Make a call and message").

Note. Two buttons should be displayed after clicking on the image.

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 a way to add a custom marker with a button or any other ideas to achieve this?

Below is a view of the map that I want to add in real time.

Thanks at Advance

enter image description here

+4
source share
4 answers

Finally, I ended my result using the link below

Google Maps Android API v2 - Interactive InfoWindow (as in the original Google Android map)

Its quiet interest for breaking layouts.

Thanks,

+4
source

If I'm not mistaken, you are looking for an infowindowadapter . Have you tried the infowindowadapter ? If this is not done, do it.

Here is the link

Visit here

Thanks. Let me know if this helps.

+6
source

From the Google Maps V2 Documentation :

Note. The displayed info window is not live. The view is displayed as an image (using View.draw (Canvas)) while it is being returned. This means that any subsequent changes to the presentation will not be displayed by the info window on the map. To update the info window later (for example, after loading the image), call showInfoWindow (). In addition, the information window will not take into account any interactivity characteristic of the normal view, such as touch events or gestures. However, you can listen to a common click throughout the info window, as described in the section below.

Therefore, you cannot add buttons to markers. The idea may be that the buttons are located somewhere in your layout and show / hide them when the user selects a marker.

+1
source

Yes, maybe For a custom marker try this code -

  googleMap.addMarker(new MarkerOptions().position(point).icon( BitmapDescriptorFactory.fromResource(R.drawable.point))); 

See the demo app for the landfill here - at androidhub4you.com

See the demo app for Circle here - at androidhub4you.com

0
source

Source: https://habr.com/ru/post/1493146/


All Articles