3

我如何让我在 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));
4

2 回答 2

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));
于 2013-05-27T22:31:40.640 回答
0

你可以这样做

CameraUpdate center= CameraUpdateFactory.newLatLng(new LatLng(lat,long));
CameraUpdate zoom=CameraUpdateFactory.zoomTo(5);

map.moveCamera(center);
map.animateCamera(zoom);
于 2013-05-25T17:21:40.510 回答