Reputation: 1139
Here is a screenshot of my application
If I touch the legend content, I can still move the map or click markers through the legend layout. Here is my XML
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MapsActivity" />
<LinearLayout
android:id="@+id/legend_popover"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="10dp"
android:background="@color/white"
android:orientation="vertical"
android:radius="7dp"
android:visibility="gone">
...
I don't want to disable the whole map, I want to disable gestures only on the legend popover. Thank you @antonio for the answer
Upvotes: 3
Views: 5486
Reputation: 3708
If you're using Kotlin:
mapView.getMapAsync {
it.uiSettings.setAllGesturesEnabled(false)
}
Upvotes: 0
Reputation: 11643
Another decent way to achieve the same.
googleMap.getUiSettings().setAllGesturesEnabled(false);
Upvotes: 6