Disable onMarkerClickListener completely in Maps API v2

后端 未结 6 1380
无人及你
无人及你 2021-02-07 08:30

I want to disable clicking/tapping on map markers. I know you can disable default behavior by setting up an empty map.setOnMarkerClickListener

6条回答
  •  情歌与酒
    2021-02-07 09:20

    class MyInfoWindowAdapter implements GoogleMap.InfoWindowAdapter
    {
         @Override
         public View getInfoContents(Marker mar)
         {
             return null;
         }
         @Override
         public View getInfoWindow(Marker mar)
         {
             return null;
         }
    }
    

    gmap.setInfoWindowAdapter(new MyInfoWindowAdapter);

    Try this code above. This will set your infowindow to null.

提交回复
热议问题