Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20039] Android: forwardGeocoder Longitude & Latitude values reverse

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2015-12-04T06:40:47.000+0000
Affected Version/sRelease 5.0.2
Fix Version/sn/a
ComponentsAndroid
LabelsCommunity
ReporterJames Childs
AssigneeAshraf Abu
Created2015-10-30T22:12:18.000+0000
Updated2017-03-22T21:44:59.000+0000

Description

The longitude and latitude values are reported in reverse order when executing the forwardGeocoder method on Android. To reproduce, copy the following code into the app.js file of a new project and run on IOS and Android emulators.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	top:'20dp',
	width:'auto'
});

win1.add(label1);

var label2 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	top:'60dp',
	width:'auto'
});

win1.add(label2);

Titanium.Geolocation.forwardGeocoder("KANSAS CITY, MISSOURI", function(g){
	if (g.success == true){
		Ti.API.info(JSON.stringify(g));
		label1.setText('Longitude: '+g.longitude);
		label2.setText('Latitude : '+g.latitude);
	} else {
		alert("Invalid stop information specified. Please check the value entered.");
	}
});

win1.open();
The results will be the longitude will be displayed in the top label, and the latitude in the bottom label on IOS, but reversed when run on Android.

Attachments

FileDateSize
Screen Shot 2015-11-02 at 11.07.16 AM.png2015-11-02T05:12:23.000+000022643
Simulator Screen Shot Nov 2, 2015, 10.59.24 AM.png2015-11-02T05:12:24.000+000032669

Comments

  1. Ashraf Abu 2015-12-04

    Tested this on 5.0.0.GA, 5.1.0.GA and 5.1.1.GA on Android. Facing no issues right now.
  2. Ashraf Abu 2015-12-04

    Resolving as invalid as it seems to be working correctly.
  3. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to previous comments.

JSON Source