首先很多新手配置高德地图会根据高德地图Demo然后做一个愉快的搬运工
以下是搬运部分代码:
UiSettings uiSettings = aMap.getUiSettings();
uiSettings.setTiltGesturesEnabled(false);//禁止地图倾斜
uiSettings.setZoomControlsEnabled(false); //隐藏比例尺
uiSettings.setRotateGesturesEnabled(false); //禁止地图旋转
uiSettings.setMyLocationButtonEnabled(false);// 设置默认定位按钮是否显示
mlocationClient = new AMapLocationClient(this);
//初始化定位参数
mLocationOption = new AMapLocationClientOption();
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
mLocationOption.setOnceLocation(false);
mLocationOption.setInterval(5000);
mLocationOption.setNeedAddress(true);
//设置定位监听
mlocationClient.setLocationListener(this);
//设置定位参数
mlocationClient.setLocationOption(mLocationOption);
//启动定位
mlocationClient.startLocation();
以为这样就可以了吗?新手会认为可以。
*注1:mlocationClie