orientation

Orientation模块管理设备的方向信息,包括alpha、beta、gamma三个方向信息,通过plus.orientation可获取设备方向管理对象。

方法:

对象:

回调方法:

权限:

5+功能模块(permissions)

{
// ...
"permissions":{
	// ...
	"Orientation": {
		"description": "方向传感器"
	}
}
}
			

OrientationOption

JSON对象,监听设备方向感应器参数

属性:

Rotation

JSON对象,设备方向信息数据

interface Rotation {
	readonly attribute float alpha;
	readonly attribute float beta;
	readonly attribute float gamma;
	readonly attribute float magneticHeading;
	readonly attribute float trueHeading;
	readonly attribute float headingAccuracy;
}
				

属性:

OrientationSuccessCallback

获取设备方向信息成功的回调函数

void onSuccess( rotation ){
	// Get orientation success code.
}
				

参数:

返回值:

void : 无

OrientationErrorCallback

获取设备方向信息失败的回调函数

void onError( error ) {
	// Get orientation error code. 
}
				

参数:

返回值:

void : 无