コード例 #1
0
  @Override
  public void onAdd() {
    mClusterManager
        .getMarkerCollection()
        .setOnMarkerClickListener(
            new BaiduMap.OnMarkerClickListener() {
              @Override
              public boolean onMarkerClick(Marker marker) {
                return mItemClickListener != null
                    && mItemClickListener.onClusterItemClick(mMarkerCache.get(marker));
              }
            });

    mClusterManager
        .getClusterMarkerCollection()
        .setOnMarkerClickListener(
            new BaiduMap.OnMarkerClickListener() {
              @Override
              public boolean onMarkerClick(Marker marker) {
                return mClickListener != null
                    && mClickListener.onClusterClick(mMarkerToCluster.get(marker));
              }
            });
  }
コード例 #2
0
 @Override
 public void onRemove() {
   mClusterManager.getMarkerCollection().setOnMarkerClickListener(null);
   mClusterManager.getClusterMarkerCollection().setOnMarkerClickListener(null);
 }