简体   繁体   English

我可以在Android的chrome上获得绝对的设备方向吗?

[英]Can I get absolute device orientation on chrome on Android?

When I experimented with device orientation a year ago, it was behaving differently on ios safari and android chrome. 一年前,当我尝试设备定位时,它在ios苹果浏览器和android chrome上的表现有所不同。 Chrome was showing absolute values, relative North, while safari was showing relative values + webkitCompassHeading which is absolute. Chrome浏览器显示的是绝对值,相对北,而野生动物园显示的是相对值+ webkitCompassHeading,这是绝对的。

But now it seems that chrome has changed, it's not showing absolute anymore, only relative. 但是现在看来,铬已经变了,它不再显示绝对值,而只是相对值。 Meaning that alpha is relative to the first measure on the page, not the north pole. 表示alpha相对于页面上的第一个小节,而不是北极。

Is it now impossible to read the compass heading in Chrome? 现在是否无法在Chrome中阅读指南针标题?

Or is there a way to read the compass? 还是有一种阅读指南针的方法?

For instance: can I somehow change how device orientation behaves do that it returns absolute:true? 例如:我可以以某种方式更改设备方向的行为,是否返回absolute:true?

我发现在实验标记的后面隐藏着绝对的deviceorientation: https ://codereview.chromium.org/1416123002/

This page from Google answers the question: https://developers.google.com/web/updates/2016/03/device-orientation-changes Google的此页面回答了以下问题: https : //developers.google.com/web/updates/2016/03/device-orientation-changes

ie, that the API has indeed changed from absolute to relative. 也就是说,API确实已从绝对更改为相对。 It discusses how to still access absolute values, as well as including some thoughts about cross browser / device compatibility. 它讨论了如何仍然访问绝对值,以及有关跨浏览器/设备兼容性的一些想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM