设置百度地图的缩放比例


/**
* 定位SDK监听函数
*/
public class MyLocationListenner implements BDLocationListener {


@Override
public void onReceiveLocation(BDLocation location) {
// map view 销毁后不在处理新接收的位置
if (location == null || mMapView == null)
return;
MyLocationData locData = new MyLocationData.Builder()
.accuracy(location.getRadius())
// 此处设置开发者获取到的方向信息,顺时针0-360
.direction(100).latitude(location.getLatitude())
.longitude(location.getLongitude()).build();
mBaiduMap.setMyLocationData(locData);
if (isFirstLoc) {
isFirstLoc = false;
LatLng ll = new LatLng(location.getLatitude(),
location.getLongitude());
// MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
// 设置缩放比例,更新地图状态
float f = mBaiduMap.getMaxZoomLevel();// 19.0 
                               
           //float m = mBaiduMap.getMinZoomLevel();//3.0 最大比例尺 
 
 
 MapStatusUpdate u = MapStatusUpdateFactory.newLatLngZoom(ll, 
 
 
 f - 2); 
 
 
 mBaiduMap.animateMapStatus(u); 
 
 
 //地图位置显示 
 
 
 Toast.makeText(LocationDemo.this, location.getAddrStr(), 
 
 
 Toast.LENGTH_SHORT).show(); 
 
 
 } 
 


 
 } 
 


 
 public void onReceivePoi(BDLocation poiLocation) { 
 
 
 } 
 
 
 }