我在示例應用程序中使用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 –