mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Tilt gesture is often incorrectly handled as rotate or pinch-to-zoom gesture

Open bamsbamx opened this issue 1 year ago • 1 comments

Environment

  • Android OS version: Android 13
  • Devices affected: Samsung Galaxy S21 (tested with)
  • Maps SDK Version: 10.14.0 and 11.0.0-rc1

Observed behavior and steps to reproduce

The tilt map gesture (with 2 fingers up or down) is too often incorrectly handled as a map rotation or pinch-to-zoom gestures and it's very difficult to tilt the map to see the terrain in 3D

Expected behavior

The gesture shouldn't be that difficult to be handled as tilt gesture

Notes / preliminary analysis

Additional links and references

Video of the problem: https://youtube.com/shorts/2U8shNJibfc

In the video, there are 7 gestures, and we can see how the 3rd and 6th gestures to tilt the map were incorrectly handled as map scroll gesture and prevented tilting the map, while the 4, 5 and 7th gestures were correctly handled

The code to show the problem was the following (attached the Compose version, but happens with View version as well):

MapboxMap(
    modifier = Modifier.fillMaxSize(),
) {
    // Get reference to the raw MapView using MapEffect
    MapEffect(Unit) { mapView ->
        mapView.mapboxMap.loadStyle(
            style(Style.SATELLITE_STREETS) {
                +projection(ProjectionName.GLOBE)
                +rasterDemSource("raster-dem") {
                    url("mapbox://mapbox.terrain-rgb")
                }
                +terrain("raster-dem") {
                    exaggeration(1.25)
                }
            }
        )
    }
}

bamsbamx avatar Nov 14 '23 20:11 bamsbamx