Google Maps removes marker route context menu

I started a new project with a Google Maps template in Android Studio and just added a marker to the map.

LatLng location = new LatLng(lat, lng); Marker marker = mMap.addMarker(new MarkerOptions() .position(location) .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker))); 

When I click the marker, a small menu appears with the Google Maps icon in the lower right corner:

the menu on the bottom right

How can I get rid of this thing? I could not find anything that I do not even know what to call it, but I really need to get rid of it.

+6
source share
1 answer

You need to call the setMapToolbarEnabled UiSettings method

Like this:

 @Override public void onMapReady(GoogleMap googleMap) { googleMap.getUiSettings().setMapToolbarEnabled(false); // Do other staff } 
+6
source

Source: https://habr.com/ru/post/982123/


All Articles