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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user