Tim Nuwin Tim Nuwin - 6 months ago 72
Android Question

Mapbox Android, How to add a button to a Marker

I am using the Mapbox Android SDK and I was wondering how you can add a button associated with a Marker pop-up.


enter image description here


You can do this by creating your own info window adapter, An example doing this can be found in the demo app here. Important code to use:

mapboxMap.setInfoWindowAdapter(new MapboxMap.InfoWindowAdapter() {
      public View getInfoWindow(@NonNull Marker marker) {


      // return the view which includes the button