Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable gestures in Mapbox v10.0?

The guide mentions disabling User Interactions for Kotlin here.

mapView = findViewById(R.id.mapView)
mapboxMap = mapView.getMapboxMap()
mapboxMap.gestures();  //Method not found??

I don't know how to code in Kotlin. I can't work it around to work with Java. In Java, it says it cannot resolve symbol 'gestures'. Same problem with other features.

like image 748
karatuno Avatar asked Sep 17 '25 17:09

karatuno


2 Answers

You need to get a reference to the GesturesPlugin, try this:

final  GesturesPlugin gesturesPlugin = GesturesUtils.getGestures((mapView));
        gesturesPlugin.setPitchEnabled(false);
        gesturesPlugin.setScrollEnabled(false);
    }
like image 98
Reafidy Avatar answered Sep 20 '25 06:09

Reafidy


I used the following methods to disable everything related to the map movement on mapbox 10

binding.mapView.gestures.pitchEnabled = false
binding.mapView.gestures.scrollEnabled = false
binding.mapView.gestures.pinchToZoomEnabled = false
binding.mapView.gestures.rotateEnabled = false
like image 25
A.Alqadomi Avatar answered Sep 20 '25 07:09

A.Alqadomi