Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20268] Android does not return STATE from reverseGeocoder result (iOS does)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-02-11T02:29:54.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid
Labelsandroid, geocoder
ReporterRyan Gartin
AssigneeHieu Pham
Created2016-01-21T19:18:40.000+0000
Updated2016-06-23T22:58:55.000+0000

Description

Titanium.Geolocation.reverseGeocoder(location.coords.latitude, location.coords.longitude, function(e){
	Ti.API.debug(JSON.stringify(e));
	var big_location = generateBubble(e.places[0].city + ", "+ e.places[0].state, {type: 'city', coords: [location.coords.longitude, location.coords.latitude], place: e.places[0]});
	$.cityState.text = "("+e.places[0].city + ", "+ e.places[0].state+")";

//result is "Savannah, (undefined)"
Works in iOS!

Comments

  1. Hans Knöchel 2016-01-24

    Looks like Android is building the address response manually, so we need to add the state key [here](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/geolocation/src/java/ti/modules/titanium/geolocation/TiLocation.java#L330-L348).
  2. Chris Bowley 2016-01-26

    [~hansknoechel] [~msamah] would it be better to just pass the server response through, so it is consistent with iOS, rather than build the address manually?
  3. Hans Knöchel 2016-01-26

    To be honest, I have no idea why its mapped manually. Would great to just come over object-encoded.
  4. Hieu Pham 2016-02-10

    master PR: https://github.com/appcelerator/titanium_mobile/pull/7705
  5. Ashraf Abu 2016-02-11

    PR merged into master.
  6. Lokesh Choudhary 2016-06-23

    Verified the fix. Closing. Environment: Appc Studio : 4.7.0.201606150733 Ti SDK : 5.4.0.v20160617074028 Ti CLI : 5.0.9 Alloy : 1.9.0 MAC El Capitan : 10.11.4 Appc NPM : 4.2.7-2 Appc CLI : 5.4.0-18 Node: 4.4.4 Nexus 6 - Android 6.0.1

JSON Source