Added more customization to cursor/keyboard rotation #1642
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.
The implementation of cursor/keyboard rotation in #1592 set the North of the map to the angle of the cursor. This is now named
setNorth
inCursorRotationBehaviour
.However, at the time I noted that an alternative might be possible, and this was requested by @androidseb (in #1592 (comment)): offsetting the current rotation based on the difference between the cursor's start and end angle, instead of just setting it. This has been named
offset
.Optionally (on by default), it is now possible to set the map's rotation to the clicked angle (when triggered as normal), instead of needing a drag.
These options are now encapsulated in a dedicated object
CursorKeyboardRotationOptions
, set fromInteractionOptions
(which has also been refactored into its own separate file to reduce the scope of 'options.dart'). Options have also been renamed to be shorter, and improve clarity within documentation.Additionally:
Note: there are many issues with the current gesture handling system, mostly inconsistent event emission, which seems to have been somewhat complicated by a different PR which added more ways to emit events: there now appears to be 3 or 4. This PR has not fixed that, and has indeed made it more inconsistent. A larger rewrite is required to fix this.