Tim Nuwin
Tim Nuwin

Reputation: 2887

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.

Edit

enter image description here

Upvotes: 1

Views: 1926

Answers (1)

cammace
cammace

Reputation: 3168

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() {
      @Nullable
      @Override
      public View getInfoWindow(@NonNull Marker marker) {

      ...

      // return the view which includes the button

      }
});

Upvotes: 2

Related Questions