Android google maps marker disable navigation

I am creating an application where users need to go to a point on the map. But they themselves must find the way to the point. I created a map with markers, but by default, if the user clicks on the marker, the options “start navigation” and “view on Google maps” are displayed. Can these options be disabled?

The options that are shown on marker click

Options that appear when you click on the marker

+58
android google-maps-android-api-2 android-maps-v2 google-maps-markers
May 20 '15 at 15:35
source share
5 answers

This thing is called a map toolbar . You can disable it by calling UiSettings.setMapToolbarEnabled (false) :

GoogleMap map; ....... //init map map.getUiSettings().setMapToolbarEnabled(false); 
+126
May 20 '15 at 15:44
source share

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

 map:uiMapToolbar="false" 
+2
Jul 20 '18 at 11:46
source share

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

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

0
May 09 '18 at 21:40
source share

In kotlin you can do:

 map.apply { uiSettings.isMapToolbarEnabled = false } 
0
Apr 09 '19 at 14:46
source share

Sometimes it is cached, so you need to wait or clear the cache.

-one
Nov 24 '16 at 8:45
source share



All Articles