How to Hide "Navigation" and "Gps Pointer" Buttons When I Click The Marker on The Android Google Map

How to hide Navigation and GPS Pointer buttons when I click the marker on the android google map

For the button group you have outlined in red, you can disable it using the setMapToolbarEnabled() method in UISettings.

From the documentation:

Sets the preference for whether the Map Toolbar should be enabled or
disabled. If enabled, users will see a bar with various
context-dependent actions, including 'open this map in the Google Maps
app' and 'find directions to the highlighted marker in the Google Maps
app'.

Code example to disable the two buttons with Java:

//Disable Map Toolbar:
mMap.getUiSettings().setMapToolbarEnabled(false);

Just in case you were also wondering about the zoom buttons, you can disable them like this with Java:

mMap.getUiSettings().setZoomControlsEnabled(false);

In Kotlin you can use property access syntax:

mMap.uiSettings.isMapToolbarEnabled = false
mMap.uiSettings.isZoomControlsEnabled = false

Android google maps marker disable navigation option

This thing is called Map Toolbar. You can disable it by calling UiSettings.setMapToolbarEnabled(false):

GoogleMap map;
....... //init map

map.getUiSettings().setMapToolbarEnabled(false);

Buttons for Navigation” and “GPS Pointer” are not visible when I click on a marker

I had this problem, Return false on your onMarkerClick so that the default behavior would be displayed.

How to disable map toolbar

Get GoogleMap object via getMapAsync, after that disable toolbar

mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.getUiSettings().setMapToolbarEnabled(false);
}
});

Hide get directions in SupporMapFragment

Just do as follows:

GoogleMap mGoogleMap;

Disable Map Toolbar:

mGoogleMap.getUiSettings().setMapToolbarEnabled(false);

How do I remove the default UI pop ups from GoogleMaps?

Have you tried using something along these lines?

GoogleMap map;

UiSettings config = map.getUiSettings();
config.setMapToolbarEnabled(false);
config.setZoomControlsEnabled(false);

From my experience this is exactly what you need.

new buttons appear automatically on google maps(Android) when click on marker?How to remove?

This thing is called Map Toolbar. You can disable it by calling UiSettings.setMapToolbarEnabled(false):

GoogleMap map;
....... //init map

map.getUiSettings().setMapToolbarEnabled(false);


Related Topics



Leave a reply



Submit