Mapbox Android,如何将按钮添加到标记

Mapbox Android, How to add a button to a Marker

我正在使用 Mapbox Android SDK,我想知道如何添加与标记弹出窗口关联的按钮。

编辑

您可以通过创建自己的信息 window 适配器来完成此操作,可以在 demo app here 中找到执行此操作的示例。要使用的重要代码:

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

      ...

      // return the view which includes the button

      }
});