简体   繁体   中英

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 . It's working but after adding it, another button has come for 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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