When I click the marker on the google map, "Navigation" and "GPS Pointer" buttons come out. How can I hide those two navigation buttons programmatically in android development?
Select the “Filter by date and product” option. Scroll down and check “Maps” and “Maps Timeline“. Then select the magnifying glass to search. Select the next to the items you wish to remove, then select the “Delete” button.
For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.
Search for a place, tap a marker, or touch and hold a spot on the map. At the bottom of the screen, tap the name or address of the place. Tap Save.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With