Skip to content
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

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

alanchenboy
Copy link
Collaborator

@alanchenboy alanchenboy commented Dec 13, 2022

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:
Screen Shot 2022-12-13 at 16 44 55

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.

Copy link
Contributor

@wipfli wipfli left a 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...

platform/ios/platform/ios/src/MGLMapView.mm Outdated Show resolved Hide resolved
platform/ios/platform/ios/src/MGLMapView.mm Outdated Show resolved Hide resolved
@alanchenboy alanchenboy force-pushed the m1SimulatorJump branch 3 times, most recently from 8109700 to ac0d751 Compare December 14, 2022 01:44
@roblabs
Copy link
Collaborator

roblabs commented Dec 14, 2022

The GitHub Action that is supposed to run has been restarted. Please monitor when approving this PR.

Failure is related to file I/O: Permission denied

2022-12-14 01:48:23.778 xcodebuild[71261:40025363]  IDETestOperationsObserverDebug: Failure collecting logarchive: Error Domain=OSLogErrorDomain Code=13 "Log archive creation failed with error 13, warnings during creation: failed to create directory: /var/tmp/test-session-systemlogs-2022.12.14_01-48-23-+0000.logarchive: Permission denied (13)
[1111](https://github.com/maplibre/maplibre-gl-native/actions/runs/3690963533/jobs/6248519378#step:13:1112)
" UserInfo={NSLocalizedDescription=Log archive creation failed with error 13, warnings during creation: failed to create directory: /var/tmp/test-session-systemlogs-2022.12.14_01-48-23-+0000.logarchive: Permission denied (13)
[1112](https://github.com/maplibre/maplibre-gl-native/actions/runs/3690963533/jobs/6248519378#step:13:1113)
}

@alanchenboy
Copy link
Collaborator Author

alanchenboy commented Dec 15, 2022

Hi @roblabs, The failing CI is caused by the main branch, and I already fixed it #599.
After rebasing all Unit tests passed.

@birkskyum birkskyum merged commit 243c1a1 into maplibre:main Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow on M1 (Grab has bugfix)
6 participants