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

Place object in the same position whether the device is in landscape or portrait orientation on iOS(location-based) #165

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

tanababy
Copy link

@tanababy tanababy commented Sep 2, 2020

⚠️ All PRs have to be done versus 'dev' branch, so be aware of that, or we'll close your issue ⚠️

What kind of change does this PR introduce?

When the device is moved from portrait to landscape on the iPhone, the placed objects are moved by 90 degrees.
My intention is that the object is placed in the same place when the device is in landscape orientation as it is when it is in portrait orientation.
While the above intention is successful on Android smartphones, this is not the case on the iPhone.
This is a bug that only happens on the iPhone.

Perhaps it has something to do with the way the iPhone gets the device angle.( webkitCompassHeading )

The approach I've considered is to rotate the camera as the device rotates.
Since safari's iOS has window.orientation, we add this value to the angle.

Can it be referenced to an Issue? If so what is the issue # ?

How can we test it?

Use any of location-based examples with the modified code.

Summary

On iOS, the objects appear to be in the same location regardless of the orientation of the device as on Android devices.

Does this PR introduce a breaking change?
No

Please TEST your PR before proposing it. Specify here what device you have used for tests, version of OS and version of Browser
iPhoneX, mobile Safari, iOS 13.6.1

Other information

@tanababy
Copy link
Author

tanababy commented Sep 2, 2020

I'm very sorry, I was wrong about the indentation rules...
I only changed line 337 of gps-camera.js. But if it doesn't work, I'll recreate the pr.

@tanababy tanababy changed the title Place object in the same position whether the device is in landscape or portrait orientation(location-based) Place object in the same position whether the device is in landscape or portrait orientation on iOS(location-based) Sep 3, 2020
@nicolocarpignoli
Copy link
Member

Hi! Thanks for the PR. Do you have tested this in both Android and iOS?

@tanababy
Copy link
Author

tanababy commented Sep 4, 2020

@nicolocarpignoli
Thanks for your reply.
Yes, here are the devices I tested:

iOS: iPhoneX(13.6.1)& iPhone11(13.65.1) browser: safari
Android: ASUS Zenfone Live (8.0.0) browser: chrome

@sinano1107
Copy link

I strongly hope that this PR will solve the problem
Switching between portrait and landscape mode causes the t-rex to turn to the right or left.

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.

4 participants