UiSettings

public final classUiSettingsextendsObject

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

Public Method Summary

boolean
isCompassEnabled()
Gets whether the compass is enabled/disabled.
boolean
isIndoorLevelPickerEnabled()
Gets whether the indoor level picker is enabled/disabled.
boolean
isMapToolbarEnabled()
Gets whether the Map Toolbar 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
isScrollGesturesEnabledDuringRotateOrZoom()
Gets whether scroll gestures are enabled/disabled during rotation and zoom gestures.
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
setIndoorLevelPickerEnabled(boolean enabled)
Sets whether the indoor level picker is enabled when indoor mode is enabled.
void
setMapToolbarEnabled(boolean enabled)
Sets the preference for whether the Map Toolbar should be enabled or disabled.
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
setScrollGesturesEnabledDuringRotateOrZoom(boolean enabled)
Sets the preference for whether scroll gestures can take place at the same time as a zoom or rotate gesture.
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.

Inherited Method Summary

Public Methods

public booleanisCompassEnabled()

Gets whether the compass is enabled/disabled.

Returns
  • trueif the compass is enabled;falseif the compass is disabled.

public booleanisIndoorLevelPickerEnabled()

Gets whether the indoor level picker is enabled/disabled. That is, whether the level picker will appear when a building with indoor maps is focused.

Returns
  • trueif the level picker is enabled;falseif the level picker is disabled.

public booleanisMapToolbarEnabled()

Gets whether the Map Toolbar is enabled/disabled.

Returns
  • trueif the Map Toolbar is enabled;false otherwise.

public booleanisMyLocationButtonEnabled()

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

Returns
  • trueif the my-location button is enabled;falseif the my-location button is disabled.

public booleanisRotateGesturesEnabled()

Gets whether rotate gestures are enabled/disabled.

Returns
  • trueif rotate gestures are enabled;falseif rotate gestures are disabled.

public booleanisScrollGesturesEnabled()

Gets whether scroll gestures are enabled/disabled.

Returns
  • trueif scroll gestures are enabled;falseif scroll gestures are disabled.

public booleanisScrollGesturesEnabledDuringRotateOrZoom()

Gets whether scroll gestures are enabled/disabled during rotation and zoom gestures.

Returns
  • trueif scroll gestures are enabled during rotate or zoom gestures; falseif scroll gestures are disabled during rotate or zoom gestures.

public booleanisTiltGesturesEnabled()

Gets whether tilt gestures are enabled/disabled.

Returns
  • trueif tilt gestures are enabled;falseif tilt gestures are disabled.

public booleanisZoomControlsEnabled()

Gets whether the zoom controls are enabled/disabled.

Returns
  • trueif the zoom controls are enabled;falseif the zoom controls are disabled;

public booleanisZoomGesturesEnabled()

Gets whether zoom gestures are enabled/disabled.

Returns
  • trueif zoom gestures are enabled;falseif zoom gestures are disabled.

public voidsetAllGesturesEnabled(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 trueto enable all gestures;falseto disable all gestures.

public voidsetCompassEnabled(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 trueto enable the compass;falseto disable the compass.

public voidsetIndoorLevelPickerEnabled(boolean enabled)

Sets whether the indoor level picker is enabled when indoor mode is enabled. If true,the level picker will appear when a building with indoor maps is focused. Iffalse,no level picker will appear - an application will need to provide its own way of selecting levels. The default behaviour is to show the level picker.

Parameters
enabled trueto show;falseto hide the level picker.

public voidsetMapToolbarEnabled(boolean enabled)

Sets the preference for whether the Map Toolbar should be enabled or disabled. If enabled, and the Map Toolbar can be shown in the current context, users will see a bar with various context-dependent actions, including 'open this map in the Google Maps app' and 'find directions to the highlighted marker in the Google Maps app'.

By default, the Map Toolbar is enabled.

Parameters
enabled trueto enable the Map Toolbar;falseto disable the Map Toolbar.

public voidsetMyLocationButtonEnabled(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 trueto enable the my-location button;falseto disable the my-location button.

public voidsetRotateGesturesEnabled(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 trueto enable rotate;falseto disable rotate gestures.

public voidsetScrollGesturesEnabled(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 trueto enable scroll gestures;falseto disable scroll gestures.

public voidsetScrollGesturesEnabledDuringRotateOrZoom(boolean enabled)

Sets the preference for whether scroll gestures can take place at the same time as a zoom or rotate gesture. If enabled, users can scroll the map while rotating or zooming the map. If disabled, the map cannot be scrolled while the user rotates or zooms the map using gestures. This setting doesn't disable scroll gestures entirely, only during rotation and zoom gestures, nor does it restrict programmatic movements and animation of the camera.

By default, scroll gestures are enabled during rotation and zoom.

Parameters
enabled trueto enable scroll gestures during rotate or zoom gestures; falseto disable scroll gestures during rotate or zoom gestures.

public voidsetTiltGesturesEnabled(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 trueto enable tilt gestures;falseto disable tilt gestures.

public voidsetZoomControlsEnabled(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 trueto enable the zoom controls;falseto disable the zoom controls.

public voidsetZoomGesturesEnabled(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 trueto enable zoom gestures;falseto disable zoom gestures.