Bart Friederichs
Bart Friederichs

Reputation: 33573

Disable built-in behaviour of Google Maps

I am using a Google Map in my Android app, but it has some unwanted behaviour. When I tap the map, it shows two icons, that you can use to switch to the web-version.

When I first create the map, it looks like this: screenshot of first map

When I tap it, it shows these two buttons: enter image description here

I want to disable that, how can I do that?

Upvotes: 0

Views: 47

Answers (2)

Eugen Pechanec
Eugen Pechanec

Reputation: 38243

getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(GoogleMap map) {
        UiSettings ui = map.getUiSettings();
        ui.setMapToolbarEnabled(false);
    }
});

Upvotes: 1

Distwo
Distwo

Reputation: 11759

You need to call UiSettings.setMapToolbarEnabled(false) to disable that.

More info here: https://developers.google.com/maps/documentation/android-api/interactivity#toolbar

Upvotes: 1

Related Questions