75

Im creating an app where users need to walk to a point on a map. But they need to find a route to the point by them selves. Ive created a map with markers but by default if a user clicks on the marker a "start navigation" and "view in google maps" option is shown. Is it possible to disable these options ?

The options that are shown on marker click

The options that are shown on marker click

Sven van den Boogaart
  • 11,833
  • 21
  • 86
  • 169

4 Answers4

158

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

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

map.getUiSettings().setMapToolbarEnabled(false);
Pavel Dudka
  • 20,754
  • 7
  • 70
  • 83
4

You can also define setMapToolbarEnabled() from the XML using the following property:

map:uiMapToolbar="false"
Gnzlt
  • 4,383
  • 2
  • 22
  • 24
  • 2
    this does not work by default, you should specify that in your xml `xmlns:map="http://schemas.android.com/apk/res-auto"` - and I think `xmlns:app="http://schemas.android.com/apk/res-auto"` is more common (app and not map) – MikeL Oct 18 '18 at 15:16
3

In kotlin you can do:

map.apply {
   uiSettings.isMapToolbarEnabled = false
}
Nicola Gallazzi
  • 7,897
  • 6
  • 45
  • 64
1

If anyone needs to do this in Google Maps v2, you set it in the map options instead of setting it on the map directly. So like this:

var mapOptions = new GoogleMapOptions().InvokeMapToolbarEnabled(false);

Øyvind Bråthen
  • 59,338
  • 27
  • 124
  • 151