Kevin Krumwiede
Kevin Krumwiede

Reputation: 10308

Removing navigation button on a GoogleMap

My app uses a GoogleMap. One of my testers reports that on his new Galaxy Tab 4 running Android 5.0.2, the map has a button on it which launches Google navigation. I did not put that button there, and I don't see it on any of my devices.

How do I get rid of that button?

Upvotes: 0

Views: 71

Answers (2)

thinkSky
thinkSky

Reputation: 34

 map.getUiSettings().setMapToolbarEnabled(false);

Upvotes: 1

Kevin Krumwiede
Kevin Krumwiede

Reputation: 10308

I got more details from the tester. The button only appears when a marker is clicked. I disabled it by setting a marker click listener that consumes the event and does nothing:

mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
    @Override
    public boolean onMarkerClick(final Marker marker) {
        return true;
    }
});

Upvotes: 0

Related Questions