Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14839] Android: Geolocation HeadingData.x value is equal to HeadingData.magneticHeading

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsgeolocation
ReporterAndrey Kon
AssigneeUnknown
Created2013-08-12T19:11:25.000+0000
Updated2018-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);

Comments

  1. Daniel Sefton 2013-08-12

    Tested and confirmed on Samsung Galaxy S2 Android 2.3.6 with Ti SDK 3.1.1 GA and 3.2 CI.
  2. jithinpv 2014-09-12

    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

JSON Source