我在示例应用程序中使用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>
我的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);
}
}
任何想法,如何使运动?
我也经历过这个。其他人在gCode网站上提出了一个问题:https://code.google.com/p/osmdroid/issues/detail?id=415&start=100 –