Book Image

Learning Android Google Maps

Book Image

Learning Android Google Maps

Overview of this book

This book helps you to overcome the most common problems faced by users and helps you create a successful map application without any hassle. The book starts with a brief description of how to set up an environment and obtain an API key to create your map application. This book will teach you about adding markers, overlays, and information windows to the map in detail. You will then dive deep into customizing various types of maps and working with location data and Google Street view. By the end of this book, you will be able to create succinct map applications in Android using Google maps efficiently.
Table of Contents (18 chapters)
Learning Android Google Maps
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Disabling/Enabling UI controls and gestures with XML attributes


Until now, we have learned how to disable UI controls and gestures programmatically using the UiSettings class. Now, let's take a look at how we can disable these UI controls using the XML attributes in our layout file.

Till this point, we've used the following layout code:

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:name="com.google.android.gms.maps.MapFragment" />

To use the XML attributes, we need to add a namespace declaration:

xmlns:map="http://schemas.android.com/apk/res-auto"

To disable the zoom controls, we can use the uiZoomControls attribute of the namespace map. The value of this attribute should be Boolean. To disable it, set it as false.

Similarly, the attributes for other UI controls and gestures are as follows:

Property

Attribute...