How to disable the map rotation feature in the Android Map Fragment

It turned out to be straight forward if you look into the right place in documentation.

There is a UiSettings class inside a GoogleMap that allows enabling and disabling of gestures.

  SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.maps_fragment);
  GoogleMap map = mapFragment.getMap();
  map.getUiSettings().setRotateGesturesEnabled(false);

Leave a Comment