简体   繁体   English

Mapbox Android,如何向标记添加按钮

[英]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. 我正在使用Mapbox Android SDK,并且想知道如何添加与“标记”弹出窗口关联的按钮。

Edit 编辑

在此处输入图片说明

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

      }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM