I'm trying to disable the zoom and pan the mapview in a mapbox. I use mapbox 0.4.0. Currently I can disable the zoom, but cannot disable the pan
MapView mv = (MapView) tab.findViewById(R.id.mapid);
mv.setZoom(14);
mv.setMaxZoomLevel(14);
mv.setMinZoomLevel(14);
Just override the OnTouch
returning true
:
mapView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
In the current version (4.1), this should probably do:
map.getUiSettings().setZoomControlsEnabled(false);
map.getUiSettings().setZoomGesturesEnabled(false);
map.getUiSettings().setScrollGesturesEnabled(false);
Or if you want to get rid of interaction completely:
map.getUiSettings().setAllGesturesEnabled(false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With