我将如何让我的谷歌地图应用程序开始放大对我目前的位置 [英] How would I make my google maps app start with zoom on my current location
本文介绍了我将如何让我的谷歌地图应用程序开始放大对我目前的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎么会让缩放对我目前的位置,而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));
这篇关于我将如何让我的谷歌地图应用程序开始放大对我目前的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文