public final class

UiSettings

extends Object
java.lang.Object
   ↳ com.google.android.gms.maps.UiSettings

Class Overview

Settings for the user interface of a GoogleMap. To obtain this interface, call getUiSettings().

Summary

Public Methods
boolean isCompassEnabled()
Gets whether the compass is enabled/disabled.
boolean isMyLocationButtonEnabled()
Gets whether the my-location button is enabled/disabled.
boolean isRotateGesturesEnabled()
Gets whether rotate gestures are enabled/disabled.
boolean isScrollGesturesEnabled()
Gets whether scroll gestures are enabled/disabled.
boolean isTiltGesturesEnabled()
Gets whether tilt gestures are enabled/disabled.
boolean isZoomControlsEnabled()
Gets whether the zoom controls are enabled/disabled.
boolean isZoomGesturesEnabled()
Gets whether zoom gestures are enabled/disabled.
void setAllGesturesEnabled(boolean enabled)
Sets the preference for whether all gestures should be enabled or disabled.
void setCompassEnabled(boolean enabled)
Enables or disables the compass.
void setMyLocationButtonEnabled(boolean enabled)
Enables or disables the my-location button.
void setRotateGesturesEnabled(boolean enabled)
Sets the preference for whether rotate gestures should be enabled or disabled.
void setScrollGesturesEnabled(boolean enabled)
Sets the preference for whether scroll gestures should be enabled or disabled.
void setTiltGesturesEnabled(boolean enabled)
Sets the preference for whether tilt gestures should be enabled or disabled.
void setZoomControlsEnabled(boolean enabled)
Enables or disables the zoom controls.
void setZoomGesturesEnabled(boolean enabled)
Sets the preference for whether zoom gestures should be enabled or disabled.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean isCompassEnabled ()

Gets whether the compass is enabled/disabled.

Returns
  • true if the compass is enabled; false if the compass is disabled.

public boolean isMyLocationButtonEnabled ()

Gets whether the my-location button is enabled/disabled.

Returns
  • true if the my-location button is enabled; false if the my-location button is disabled.

public boolean isRotateGesturesEnabled ()

Gets whether rotate gestures are enabled/disabled.

Returns
  • true if rotate gestures are enabled; false if rotate gestures are disabled.

public boolean isScrollGesturesEnabled ()

Gets whether scroll gestures are enabled/disabled.

Returns
  • true if scroll gestures are enabled; false if scroll gestures are disabled.

public boolean isTiltGesturesEnabled ()

Gets whether tilt gestures are enabled/disabled.

Returns
  • true if tilt gestures are enabled; false if tilt gestures are disabled.

public boolean isZoomControlsEnabled ()

Gets whether the zoom controls are enabled/disabled.

Returns
  • true if the zoom controls are enabled; false if the zoom controls are disabled;

public boolean isZoomGesturesEnabled ()

Gets whether zoom gestures are enabled/disabled.

Returns
  • true if zoom gestures are enabled; false if zoom gestures are disabled.

public void setAllGesturesEnabled (boolean enabled)

Sets the preference for whether all gestures should be enabled or disabled. If enabled, all gestures are available; otherwise, all gestures are disabled. This doesn't restrict users from tapping any on screen buttons to move the camera (e.g., compass or zoom controls), nor does it restrict programmatic movements and animation.

Parameters
enabled true to enable all gestures; false to disable all gestures.

public void setCompassEnabled (boolean enabled)

Enables or disables the compass. The compass is an icon on the map that indicates the direction of north on the map. If enabled, it is only shown when the camera is tilted or rotated away from its default orientation (tilt of 0 and a bearing of 0). When a user clicks the compass, the camera orients itself to its default orientation and fades away shortly after. If disabled, the compass will never be displayed.

By default, the compass is enabled (and hence shown when the camera is not in the default orientation).

Parameters
enabled true to enable the compass; false to disable the compass.

public void setMyLocationButtonEnabled (boolean enabled)

Enables or disables the my-location button. The my-location button causes the camera to move such that the user's location is in the center of the map. If the button is enabled, it is only shown when the my-location layer is enabled.

By default, the my-location button is enabled (and hence shown when the my-location layer is enabled).

Parameters
enabled true to enable the my-location button; false to disable the my-location button.

public void setRotateGesturesEnabled (boolean enabled)

Sets the preference for whether rotate gestures should be enabled or disabled. If enabled, users can use a two-finger rotate gesture to rotate the camera. If disabled, users cannot rotate the camera via gestures. This setting doesn't restrict the user from tapping the compass icon to reset the camera orientation, nor does it restrict programmatic movements and animation of the camera.

By default, rotate gestures are enabled.

Parameters
enabled true to enable rotate gestures; false to disable rotate gestures.

public void setScrollGesturesEnabled (boolean enabled)

Sets the preference for whether scroll gestures should be enabled or disabled. If enabled, users can swipe to pan the camera. If disabled, swiping has no effect. This setting doesn't restrict programmatic movement and animation of the camera.

By default, scroll gestures are enabled.

Parameters
enabled true to enable scroll gestures; false to disable scroll gestures.

public void setTiltGesturesEnabled (boolean enabled)

Sets the preference for whether tilt gestures should be enabled or disabled. If enabled, users can use a two-finger vertical down swipe to tilt the camera. If disabled, users cannot tilt the camera via gestures. This setting doesn't restrict users from tapping the compass icon to reset the camera orientation, nor does it restrict programmatic movement and animation of the camera.

By default, tilt gestures are enabled.

Parameters
enabled true to enable tilt gestures; false to disable tilt gestures.

public void setZoomControlsEnabled (boolean enabled)

Enables or disables the zoom controls. If enabled, the zoom controls are a pair of buttons (one for zooming in, one for zooming out) that appear on the screen. When pressed, they cause the camera to zoom in (or out) by one zoom level. If disabled, the zoom controls are not shown.

By default, the zoom controls are enabled.

Parameters
enabled true to enable the zoom controls; false to disable the zoom controls.

public void setZoomGesturesEnabled (boolean enabled)

Sets the preference for whether zoom gestures should be enabled or disabled. If enabled, users can either double tap/two-finger tap or pinch to zoom the camera. If disabled, these gestures have no effect. This setting doesn't affect the zoom buttons, nor does it restrict programmatic movement and animation of the camera.

By default, zoom gestures are enabled.

Parameters
enabled true to enable zoom gestures; false to disable zoom gestures.