Add pinch gesture tradeoff configuration option #890
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request checklist:
Summary of changes
In #837, we fixed #775, but the solution introduced a new issue, #864. At the moment, we don't have a way to solve both issues simultaneously, so this PR introduces a configuration option to allow developers to make the tradeoff between the two issues that is best for their use case.
The new configuration option is marked as experimental because we hope to eliminate the need for developers to make this tradeoff in a future release. Note that experimental APIs may be modified or removed without a major version bump.
The default configuration is set to match the v10.1 behavior.
To use the new option, annotate your import statement with
@_spi(Experimental)
and then setmapView.gestures.options.pinchBehavior = .doesNotResetCameraAtEachFrame
.This option may be changed dynamically at any time and the change will take effect when the next pinch gesture begins.