0

I inserted the following fragment inside a NestedScrollView and inside a table layout:

<fragment xmlns:map="http://schemas.android.com/apk/res-auto"
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="200dp"
        android:layout_height="200dp"
        map:mapType="normal"
        map:cameraZoom="13"/>

where I want to see the google maps view. Inside Java code I put these attributes:

   @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        mUiSettings = mMap.getUiSettings();
        mMap.setMinZoomPreference(10.0f);
        mMap.setMaxZoomPreference(20.0f);
        mUiSettings.setZoomGesturesEnabled(true);
        mUiSettings.setScrollGesturesEnabled(true);
        mUiSettings.setTiltGesturesEnabled(true);
    }

Map and markers seems working properly, the zoom-in by double-single click works, the zoom-out by 2 finger-double click works, the pinch-to-zoom and drag inside map instead do not work properly, they are very jerky. Dragging to right or left, map moves a little and stops, the same for pinch zoom. Any suggestion?

Kasım Özdemir
  • 5,414
  • 3
  • 18
  • 35

1 Answers1

0

You can try change NestedScrollView to ScrollView.

fujian26
  • 70
  • 7
  • That's perfect for the scroll now, with ScrollView instead of nested one it works properly. The remaining problem now is that I need to block the scroll when I move fingers inside map. I tried some solutions found here in stackoverflow but are not good. I will find others. Thanks a lot fujian26 for this solution. – Mauro Marchiori Apr 23 '20 at 10:14