I am using SupportMapFragment to display a static map in a ScrollView. I donβt like to move / scale the map, just indicating where the place is.
When I scroll the map up, the map shakes inside its borders, it feels pretty laggy. My question is how to remove this backlog or how to use the static version of v2 api map.
This is my layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="@dimen/margin_half" android:background="@color/white" android:orientation="vertical" > ... <fragment android:id="@+id/fragmentMap" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="300dp" android:layout_alignParentLeft="true" android:layout_below="@id/viewDivider" android:layout_margin="@dimen/margin_half" /> <View android:layout_width="match_parent" android:layout_height="300dp" android:layout_alignBottom="@id/fragmentMap" android:layout_alignLeft="@id/fragmentMap" android:layout_alignRight="@id/fragmentMap" android:layout_alignTop="@id/fragmentMap" android:background="@android:color/transparent" /> ... </RelativeLayout>
This is not related to MapFragment in ScrollView , although I used this trick to remove black trim on older devices, as you can see with a transparent view,
I also turned off all gestures and the ability to click on the map:
getMap().getUiSettings().setAllGesturesEnabled(false); getMap().getUiSettings().setZoomControlsEnabled(false); getMap().getUiSettings().setMyLocationButtonEnabled(false); ... mapView.setClickable(false); mapView.setFocusable(false); mapView.setDuplicateParentStateEnabled(false);
android android-maps-v2 scrollview
joecks Jul 24 '13 at 9:11 2013-07-24 09:11
source share