Tim Nuwin Tim Nuwin - 1 year ago 187
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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download