无法平移或移动osmdroid地图

Ray*_*Ray 1 android osmdroid

我在示例应用程序中使用osmdroid映射.看到地图,缩放工作,一切都很好,除了我无法平移/移动地图.

我的主要xml代码是:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <org.osmdroid.views.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:focusable="true"
        android:focusableInTouchMode="true">

    </org.osmdroid.views.MapView>

 </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我的java代码是:

 public class MapTest extends Activity {

private MapView mapView;
private MapController mapController;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map_test);
    mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(false);
    mapView.setMultiTouchControls(true);
    mapController = this.mapView.getController();
    mapController.setZoom(10);
    GeoPoint mapCenter = new GeoPoint(17.4467, 78.4667);
    mapController.setCenter(mapCenter);
}

}
Run Code Online (Sandbox Code Playgroud)

关于如何启用运动的任何想法?

kur*_*arc 6

尝试删除:

android:clickable="true"
Run Code Online (Sandbox Code Playgroud)

从你的MapView.这使得MapView消耗触摸事件,并且它与dispatchTouchEvent方法混淆.您也可以尝试删除可聚焦的东西.