Place object in the same position whether the device is in landscape or portrait orientation on iOS(location-based) #165
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.
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