Working with UI controls

The Google map's API provides some inbuilt UI controls to make our task easier. The UI controls that can be enabled or disabled are as follows:

  • Zoom controls
  • Compass
  • My Location button
  • Level picker

Let's learn about these UI controls in more detail.

Zoom controls

Zoom controls are normally used for zoom-in and zoom-out functions. These buttons are disabled by default. The new version of the Google Maps application has removed these controls. It is up to you to display or disable them in your application.

These zoom controls are enabled or disabled using the UiSettings class, which can be obtained by calling the getUiSettings() method on the GoogleMap object. Then, call the setZoomControlsEnabled() method on the obtained UiSettings ...

Get Learning Android Google Maps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.