百度地图开发(三)隐藏Logo/比例尺/缩放控件/放大缩小方法

隐藏百度地图的Logo:

View child = mMapView.getChildAt(1);
if (child != null && (child instanceof ImageView || child instanceof ZoomControls)) {
        child.setVisibility(View.INVISIBLE);
   }

百度地图隐藏比例尺:

mMapView.showScaleControl(false);

百度地图隐藏缩放控件:

mMapView.showZoomControls(false);

更换放大缩小图标:

先隐藏放大缩小控件,在地图上新增图标,设置图标的点击事件

放大的图标点击事件里面添加:

MapStatusUpdate zoomIn = MapStatusUpdateFactory.zoomIn();
mBaiduMap.animateMapStatus(zoomIn);

缩小的图标点击事件里面添加:

MapStatusUpdate zoomOut = MapStatusUpdateFactory.zoomOut();
mBaiduMap.animateMapStatus(zoomOut);

 

 

 

转载自:https://blog.csdn.net/lanrenxiaowen/article/details/83349188

You may also like...