Sven van den Boogaart
Sven van den Boogaart

Reputation: 12325

Android google maps marker disable navigation option

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

Upvotes: 75

Views: 18740

Answers (5)

arnaldo.crescente
arnaldo.crescente

Reputation: 41

You can set toolbarEnabled MapView props to false

Upvotes: 0

Nicola Gallazzi
Nicola Gallazzi

Reputation: 8713

In kotlin you can do:

map.apply {
   uiSettings.isMapToolbarEnabled = false
}

Upvotes: 3

Gnzlt
Gnzlt

Reputation: 4582

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

map:uiMapToolbar="false"

Upvotes: 4

Øyvind Bråthen
Øyvind Bråthen

Reputation: 60714

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);

Upvotes: 1

Pavel Dudka
Pavel Dudka

Reputation: 20944

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

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

map.getUiSettings().setMapToolbarEnabled(false);

Upvotes: 158

Related Questions