我可以使用mMap.getUiSettings().setZoomGesturesEnabled(false)禁用两种放大/输出手势,但是如何禁用只缩小手势呢?
更新
我真正需要的是允许用户查看地图,直到达到指定的缩放级别。例如,如果缩放级别设置为17,则允许用户放大并滚动地图,而不离开缩放级别17中显示的区域,并再次缩小到级别17。
发布于 2016-10-11 11:18:15
SupportMapFragment mapView = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map));
View zoomControls = mapView.getView().findViewById(0x1);
for(int i=0;i<((ViewGroup)zoomControls).getChildCount();i++){
View child=((ViewGroup)zoomControls).getChildAt(i);
if (i==0) {
// there is your "+" button, zoom in
}
if (i==1) {
// there is your "-" button, I hide it in this example
child.setVisibility(View.GONE);
}
}https://stackoverflow.com/questions/39975985
复制相似问题