My Problem: I can just scroll up and down within my MapView, not left and right.
I have a MapView in my LinearLayout, which is holded by a Nested Scroll View. So my layout.xml looks like this:
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
...
<com.google.android.gms.maps.MapView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="10dp"
android:id="@+id/jd_map_view"/>
...
</LinearLayout>
I'm initializing the MapView in my Fragment, holded by a TabLayout, like this:
mapView = (MapView) mRootView.findViewById(R.id.jd_map_view);
mapView.onCreate(savedInst);
mapView.onResume();
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
LatLng latlng = new LatLng(mLat, mLng);
googleMap.addMarker(new MarkerOptions().position(latlng));
CameraUpdate center= CameraUpdateFactory.newLatLng(latlng);
CameraUpdate zoom=CameraUpdateFactory.zoomTo(14);
googleMap.moveCamera(center);
googleMap.animateCamera(zoom);
}
});
It works more or less correctly, means I see a Map, see my Marker and the Map is on the right Position. But unforunately, I can't scroll right...