本文整理汇总了Java中org.osmdroid.views.MapController.setCenter方法的典型用法代码示例。如果您正苦于以下问题:Java MapController.setCenter方法的具体用法?Java MapController.setCenter怎么用?Java MapController.setCenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.views.MapController
的用法示例。
在下文中一共展示了MapController.setCenter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openStreetMapInit
import org.osmdroid.views.MapController; //导入方法依赖的package包/类
private void openStreetMapInit() {
setContentView(R.layout.activity_openstreetmapgpsmanager);
mMapView = (MapView) findViewById(R.id.OSMGPSmanager);
MapController mController = mMapView.getController();
mMapView.setTileSource(TileSourceFactory.MAPNIK);
mMapView.setBuiltInZoomControls(true);
mMapView.setMultiTouchControls(true);
imageUri = (Uri) getIntent().getExtras().get("imageUri");
try {
String degreeGPS = new ConvertLatlng().convertToDegreeForm(imageUri.getPath());
String[] position = degreeGPS.split(";");
GeoPoint center = new GeoPoint(Double.parseDouble(position[0]), Double.parseDouble(position[1]));
mController.setCenter(center);
mController.setZoom(13);
} catch (IOException e) {
e.printStackTrace();
}
}
示例2: setupMapView
import org.osmdroid.views.MapController; //导入方法依赖的package包/类
private void setupMapView() {
mMapView.setMultiTouchControls(true);
mMapView.setUseDataConnection(true);
mMapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
mMapController = (MapController) mMapView.getController();
mMapController.setZoom(13);
mMapController.setCenter(BERLIN);
fetchPois();
}
示例3: init_mapView
import org.osmdroid.views.MapController; //导入方法依赖的package包/类
private void init_mapView() {
mMapView = (MapView) findViewById(R.id.myOSMmapview);
MapController mController = mMapView.getController();
mMapView.setTileSource(TileSourceFactory.MAPNIK);
mMapView.setBuiltInZoomControls(true);
mMapView.setMultiTouchControls(true);
LatLng latLng = getCurrentLocation();
GeoPoint center = new GeoPoint(latLng.latitude, latLng.longitude);
mController.setCenter(center);
mController.setZoom(13);
}