-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS]Use custom gesture to solve the map jump on m1 simulator #594
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @alanchenboy for sharing this. I don't have a mac at the moment so I cannot test this directly, but since all the code is inside a #if TARGET_IPHONE_SIMULATOR
guard it will not change the behavior of the main code so we should be able to integrate this I think...
8109700
to
ac0d751
Compare
The GitHub Action that is supposed to run has been restarted. Please monitor when approving this PR. Failure is related to file I/O:
|
ac0d751
to
d253e46
Compare
d253e46
to
92adfdf
Compare
92adfdf
to
8d49720
Compare
This Fixes #563
In Grab, our Apps don't use the arm64 version of iOS simulator SDKs for some reason. That means our code architecture is x86_64 and running under the rosetta stone on the m1 simulator. The project setting is:
But at this condition, the gesture's velocity will become very large or keep zero, and this also can reproduce with Maplibre, you can see the map jump very far when the pan over:
Screen.Recording.2022-12-13.at.16.26.58.mp4
The rotate gesture and the pinch gesture have the same problem.
So I create this fix, which is actually a workaround for m1 simulator users, I create custom gestures to calculate velocity and make the map handle correctly.
And this is the final result of this fix:
Screen.Recording.2022-12-13.at.16.47.35.mp4
I know this may not be necessary for most situations. But it is a must-have fix or workaround for Grab because a lot of developers running their maps in this situation. So please assess whether this PR needs to be merged into Maplibre.