我怎么会让缩放对我目前的位置,而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));