我将如何让我的谷歌地图应用程序开始放大对我目前的位置我的、对我、我将、应用程序

2023-09-06 05:02:34 作者:蓝穹

我怎么会让缩放对我目前的位置,而pressing或做任何事情我在Android上启动谷歌地图应用程序?

编辑。问题就解决了​​。

 标准CRI =新标准();
    字符串BBB = locationmanager.getBestProvider(CRI,真正的);
    位置myLocation = locationmanager.getLastKnownLocation(BBB);

    双纬度= myLocation.getLatitude();
    双长= myLocation.getLongitude();
    经纬度LL =新的经纬度(纬度,长);

    mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LL,20));
 

解决方案

问题解决了。

 标准CRI =新标准();
字符串BBB = locationmanager.getBestProvider(CRI,真正的);
位置myLocation = locationmanager.getLastKnownLocation(BBB);

双纬度= myLocation.getLatitude();
双长= myLocation.getLongitude();
经纬度LL =新的经纬度(纬度,长);

mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(LL,20));
 

谷歌地图

How would I make my google maps app on android start with zoom on my current location without pressing or doing anything?

edit. problem solved

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));

解决方案

Problem solved

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));