本文整理汇总了Java中org.osmdroid.views.MapController.setZoom方法的典型用法代码示例。如果您正苦于以下问题:Java MapController.setZoom方法的具体用法?Java MapController.setZoom怎么用?Java MapController.setZoom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.views.MapController
的用法示例。
在下文中一共展示了MapController.setZoom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例4: onCreate
import org.osmdroid.views.MapController; //导入方法依赖的package包/类
/**
* Init method for instanciate all variables
* @param savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
//region initVars
double dLat = getIntent().getDoubleExtra("xtra_destination_lat", 0);
double dLong = getIntent().getDoubleExtra("xtra_destination_long",0);
busDeparture = (Departure)getIntent().getSerializableExtra("xtra_bus_depart") ;
distGoal = (TextView) findViewById(R.id.tV_distance_goal);
timeLeft = (TextView) findViewById(R.id.tV_time_left);
timeToBus = (TextView) findViewById(R.id.tV_time_left_to_bus);
destinationLocation = new GeoPoint(dLat, dLong);
//endregion
//region GPS Location init
if (!MainActivity.demomode) {
// get GPS manager -> GPS longitude, latitude in onLocationChanged
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
String locationProvider = LocationManager.GPS_PROVIDER;
try {
locationManager.requestLocationUpdates(locationProvider, 0, 0, Activity2.this);
}
catch(final SecurityException ex) {
Toast.makeText(this, "Leider können wir ohne GPS keine Route berechnen", Toast.LENGTH_SHORT).show();
}
}
else {
android.os.Handler handler = new android.os.Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Location location = new Location("");
location.setLatitude(48.4224);//your coords of course
location.setLongitude(9.9579);
onLocationChanged(location);
}
},1000);
}
//endregion
//Map view init
// MapView integration
mMapView = (MapView) findViewById(R.id.mapview_calculated);
mMapView.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
mMapView.setBuiltInZoomControls(true);
mMapView.setMultiTouchControls(true);
mMapController = (MapController) mMapView.getController();
mMapController.setZoom(17);
//endregion
//road manager init
roadManager = new MapQuestRoadManager("DIGIF2BiDrtD1Xbi28SXrkd9Ap2h73Vn");
roadManager.addRequestOption("routeType=pedestrian");
}