Is there a way to disable the zooming (pinch and double tap) in the MapView
but keep the scrolling?
This means setting clickable to false would not work.
I have also tried setting an onTouch listener
in the activity
but it will not trigger using:
mapView.setOnTouchListener(this);
The Maps API provides built-in zoom controls that appear in the bottom right hand corner of the map. These are disabled by default, but can be enabled by calling UiSettings. setZoomControlsEnabled(true) .
You can change the zoom level of the map using simple steps. Step 1 Go to Add or Edit Map page . Step 2 Select 'Default zoom level' in the 'Map Information section'. Step 3 click save map and see the changes.
The Google Maps API provides map tiles at various zoom levels for map type imagery. Most roadmap imagery is available from zoom levels 0 to 18, for example. Satellite imagery varies more widely as this imagery is not generated, but directly photographed.
import com.google.android.gms.maps.GoogleMap;
public void onMapReady(GoogleMap map) {
...
map.getUiSettings().setZoomGesturesEnabled(false);
UiSettings Documentation
You can assign those properties using the XML
file:
map:uiRotateGestures="true"
map:uiScrollGestures="true"
map:uiTiltGestures="true"
map:uiZoomGestures="true"
So use:
map:uiZoomGestures="false"
On the MapFragment
object.
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