【文件属性】:
文件名称:cordova插件设备定向:Apache Cordova插件设备定向
文件大小:58KB
文件格式:ZIP
更新时间:2021-02-03 06:27:54
nodejs javascript java cordova library
标题
描述
设备方向
访问指南针数据。
AppVeyor
特拉维斯CI
Cordova插件设备定向
使用须知
使用 ,Android,iOS和Windows设备可能不再需要此插件。
但是,在iOS 13+上,可能会出现权限和安全上下文的潜在问题。 因此,建议使用此插件,因为它使用本机实现。
描述
该插件可访问设备的指南针。 指南针是一种传感器,通常会从设备顶部检测指向设备的方向或方向。 它以0至359.99的度数度量航向,其中0为北。
通过全局navigator.compass对象进行访问。
尽管对象已附加到全局范围的navigator ,但直到deviceready事件之后该对象deviceready 。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.compass);
}
在上报告问题
安装
cordova plugin add cordova-plugin-device-orient
【文件预览】:
cordova-plugin-device-orientation-master
----plugin.xml(3KB)
----.github()
--------ISSUE_TEMPLATE.md(1KB)
--------PULL_REQUEST_TEMPLATE.md(1KB)
--------ISSUE_TEMPLATE()
----www()
--------CompassHeading.js(1KB)
--------CompassError.js(1KB)
--------compass.js(5KB)
----src()
--------windows()
--------ios()
--------android()
--------browser()
----RELEASENOTES.md(9KB)
----.eslintrc.yml(931B)
----.npmignore(9B)
----types()
--------index.d.ts(3KB)
----CONTRIBUTING.md(1KB)
----.travis.yml(2KB)
----LICENSE(11KB)
----README.md(6KB)
----.appveyor.yml(542B)
----NOTICE(163B)
----tests()
--------plugin.xml(1KB)
--------tests.js(13KB)
--------package.json(284B)
----.gitignore(175B)
----package-lock.json(64KB)
----package.json(959B)