[TIMOB-14839] Android: Geolocation HeadingData.x value is equal to HeadingData.magneticHeading
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.1.1, Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | geolocation |
Reporter | Andrey Kon |
Assignee | Unknown |
Created | 2013-08-12T19:11:25.000+0000 |
Updated | 2018-02-28T20:04:24.000+0000 |
Description
HeadingData returns magneticHeading instead of X axis value.
Both properties contain the same value:
Ti.Geolocation.purpose = "Testing Magnetic Heading";
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var Y = Ti.UI.createLabel({
font : {
fontSize : 30
},
text : "[Y]",
top : 10,
right : 5
});
var X = Ti.UI.createLabel({
font : {
fontSize : 30
},
text : "[X]",
top : 50,
right : 5
});
var magneticHeading = Ti.UI.createLabel({
font : {
fontSize : 30
},
text : "[magneticHeading]",
top : 90,
right : 5
});
win.add(Y);
win.add(X);
win.add(magneticHeading);
win.open();
function onMag(e) {
Y.text = 'Y: ' + e.heading.y;
X.text = 'X: ' + e.heading.x;
magneticHeading.text = 'magneticHeading: ' + e.heading.magneticHeading;
}
Ti.Geolocation.addEventListener('heading', onMag);
Tested and confirmed on Samsung Galaxy S2 Android 2.3.6 with Ti SDK 3.1.1 GA and 3.2 CI.
Issue reproduces Titanium SDK version 3.4.0 master, 3.2.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4