set default move gesture threshold to a small non-zero value (#3573)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Tobias Zwick
2025-06-23 18:36:33 +02:00
committed by GitHub
parent 1899cde3bd
commit 2e0b464849
5 changed files with 42 additions and 52 deletions

View File

@@ -314,7 +314,8 @@ final class LocationCameraController {
if (isLocationTracking()) {
moveGestureDetector.setMoveThreshold(options.trackingInitialMoveThreshold());
} else {
moveGestureDetector.setMoveThreshold(0f);
float initialMoveThreshold = initialGesturesManager.getMoveGestureDetector().getMoveThreshold();
moveGestureDetector.setMoveThreshold(initialMoveThreshold);
moveGestureDetector.setMoveThresholdRect(null);
}
}

View File

@@ -169,8 +169,15 @@ final class MapGestureDetector {
androidGesturesManager.setMutuallyExclusiveGestures(shoveScaleSet, shoveRotateSet, ScaleLongPressSet);
}
// If this was 0°, every shove gesture (for tilting the map) would be detected as also a rotate
androidGesturesManager.getRotateGestureDetector().setAngleThreshold(3f);
// If this was 0 (the default), a simple tap would also be detected as a move. A (very) small
// move threshold solves this issue, while not making the map feel "sticky". (See #2792)
androidGesturesManager.getMoveGestureDetector().setMoveThresholdResource(R.dimen.maplibre_minimum_move_threshold);
gesturesManager = androidGesturesManager;
gesturesManager.getRotateGestureDetector().setAngleThreshold(3f);
}
/**