mapbox / mapbox/mapbox-maps-android
Tilt gesture is often incorrectly handled as rotate or pinch-to-zoom gesture
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
## 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)
}
}
)
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the tilt gesture with the provided Compose MapboxMap example on Android 13 and the listed Maps SDK versions, using the linked video as a reference. Start by locating the gesture-handling entry point for tilt, rotation, pinch-to-zoom, and scroll; done means two-finger tilt gestures are recognized more consistently without being incorrectly handled as another gesture.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100