如何在Android上启动谷歌地图应用程序,在不按或做任何事情的情况下放大我当前的位置?
修改。问题解决了
Criteria cri= new Criteria();
String bbb = locationmanager.getBestProvider(cri, true);
Location myLocation = locationmanager.getLastKnownLocation(bbb);
double lat= myLocation.getLatitude();
double long = myLocation.getLongitude();
LatLng ll = new LatLng(lat, long);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ll, 20));
答案 0 :(得分:4)
问题解决了
Criteria cri= new Criteria();
String bbb = locationmanager.getBestProvider(cri, true);
Location myLocation = locationmanager.getLastKnownLocation(bbb);
double lat= myLocation.getLatitude();
double long = myLocation.getLongitude();
LatLng ll = new LatLng(lat, long);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ll, 20));
答案 1 :(得分:0)
你可以这样做
CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(lat,long));
CameraUpdate zoom=CameraUpdateFactory.zoomTo(5);
map.moveCamera(center);
map.animateCamera(zoom);