如何在 android 上的地图片段上设置 google 地图填充?而且我不想拖动地图
How to set google map padding on map fragment on android? and also I want to not drag able the map
我正在尝试为我的 Google mMap.setPadding
设置填充。它正在工作,但在添加它之后,另一个按钮出现了 move to the current location
我不要这个。
而且我还想禁用地图拖动功能。
下面是我的代码:
int width = getResources().getDisplayMetrics().widthPixels;
int padding = (int) (width * 0.20);
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);
mMap.setPadding( 0, 270, 0, 430);
mMap.animateCamera(cu);
你应该这样做:
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setZoomGesturesEnabled(true);
我正在尝试为我的 Google mMap.setPadding
设置填充。它正在工作,但在添加它之后,另一个按钮出现了 move to the current location
我不要这个。 而且我还想禁用地图拖动功能。
下面是我的代码:
int width = getResources().getDisplayMetrics().widthPixels;
int padding = (int) (width * 0.20);
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);
mMap.setPadding( 0, 270, 0, 430);
mMap.animateCamera(cu);
你应该这样做:
mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setZoomGesturesEnabled(true);