在Android中使用MapView,我如何设置默认位置,以便每次加载此应用程序时,它可以自动将地图中心/缩放到伦敦?
在Android中使用MapView,我如何设置默认位置,以便每次加载此应用程序时,它可以自动将地图中心/缩放到伦敦?
首先,获取给定地图的控制器:
MapController myMapController = myMapView.getController();
然后调用:
myMapController.setCenter(new GeoPoint())
mapFragment.getMapAsync(this::setUpMaps);
setUpMaps(GoogleMap googleMap)
中,您应该将相机移动到默认位置:googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, zoom));