发布网友 发布时间:2022-04-22 05:43
共1个回答
热心网友 时间:2023-09-26 03:29
// 隐藏缩放控件
int childCount = mMapView.getChildCount();
View zoom = null;
for (int i = 0; i < childCount; i++) {
View child = mMapView.getChildAt(i);
if (child instanceof ZoomControls) {
zoom = child;
break;
}
}
zoom.setVisibility(View.GONE);
// 隐藏比例尺控件
int count = mMapView.getChildCount();
View scale = null;
for (int i = 0; i < count; i++) {
View child = mMapView.getChildAt(i);
if (child instanceof ZoomControls) {
scale = child;
break;
}
}
scale.setVisibility(View.GONE);
// 隐藏指南针
mUiSettings = mBaiMap.getUiSettings();
mUiSettings.setCompassEnabled(true);
// 删除百度地图logo
mMapView.removeViewAt(1);