简体   繁体   English

如何在Android的地图片段上设置Google Map Padding? 而且我也不想拖动地图

[英]How to set google map padding on map fragment on android? and also I want to not drag able the map

I am trying to set padding to my Google mMap.setPadding . 我正在尝试将填充设置为我的Google mMap.setPadding It's working but after adding it, another button has come for move to the current location 它可以正常工作,但是添加后,另一个按钮已move to the current location

在此处输入图片说明

I dont want this. 我不想要这个。 And also I want to map drag feature to be disabled. 我也想禁用地图拖动功能。

Below is my code: 下面是我的代码:

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);

you should do this: 你应该做这个:

mMap.getUiSettings().setScrollGesturesEnabled(true);
mMap.getUiSettings().setZoomGesturesEnabled(true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM