2

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.

Reafidy
  • 8,240
  • 5
  • 51
  • 83
karatuno
  • 365
  • 5
  • 18

2 Answers2

4

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

final  GesturesPlugin gesturesPlugin = GesturesUtils.getGestures((mapView));
        gesturesPlugin.setPitchEnabled(false);
        gesturesPlugin.setScrollEnabled(false);
    }
Reafidy
  • 8,240
  • 5
  • 51
  • 83
0

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
A.Alqadomi
  • 1,529
  • 3
  • 25
  • 33