mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
464 stars 131 forks source link

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

Open bamsbamx opened 10 months ago

bamsbamx commented 10 months ago

Environment

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)
                }
            }
        )
    }
}
raycar5 commented 3 weeks ago

I'm also quite annoyed by this, is there any api available to configure the sensitivity? even if it means perhaps providing a custom GesturesPlugin?