javaandroidgoogle-mapsgoogle-apimapactivity

How to set google map padding on map fragment on android? and also I want to not drag able the map


I am trying to set padding to my Google mMap.setPadding . It's working but after adding it, another button has come for move to the current location

enter image description here

I dont want this. And also I want to map drag feature to be disabled.

Below is my code:

int width = getResources().getDisplayMetrics().widthPixels;
int padding = (int) (width * 0.20);
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);
mMap.setPadding(     0,      270,      0,     430);
mMap.animateCamera(cu);

Solution

  • you should do this:

    mMap.getUiSettings().setScrollGesturesEnabled(true);
    mMap.getUiSettings().setZoomGesturesEnabled(true);