Disabling/enabling the UI controls and gestures with the GoogleMapOptions object
Until now, we've added MapFragment
directly in our layout and used the UiSettings
class to change the controls. In Chapter 2, Configuring an API Key and Creating Our First Map Application, we learned how to add MapFragment
dynamically in FrameLayout
. Let's now discuss how to disable UI controls and gestures using the GoogleMapOptions
object for a dynamically added fragment.
Our layout code is as follows:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout>
activity_maps.xml
Next, in MapsActivity
, we are going to replace the contents of FrameLayout
with MapFragment
.
To construct MapFragment
, we can...