Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Low
-
Resolution: Won't Fix
-
Affects Version/s: Release 3.0.0
-
Fix Version/s: 2013 Sprint 04 API, 2013 Sprint 04
-
Component/s: iOS
-
Labels:None
-
Environment:
MobileSDK 3.0.0.GA
Platform: iOS 6 simulator & iPhone 4
Description
Problem Description
When you pass a non us address to Ti.GeoLocation.forwardGeocoder(), it will fail returning null values.
Test Case
Same location queried through out Maps GoogleAPIs returns coords according the place.
var nonUS = "Hyderabad";
|
var Tokio = "Tokio";
|
var US = "Salt Lake city";
|
|
Titanium.Geolocation.forwardGeocoder( nonUS, function(evt)
|
{
|
Ti.API.info( "lat: "+evt.latitude+", long: "+ evt.longitude );
|
Ti.API.info( JSON.stringify(evt) );
|
});
|
|
xhr = Titanium.Network.createHTTPClient();
|
var query = nonUS;
|
xhr.open('GET', 'http://maps.googleapis.com/maps/geo?output=json&q=' + query);
|
xhr.onload = function() {
|
var json = JSON.parse(this.responseText);
|
Ti.API.info(json);
|
//17.385044,78.486671
|
};
|
xhr.send();
|
|
Extra info
The customer just want to show a proper annotation in the map to a particular location. i.e., need latitude and longitude values for "Ameerpet, Hyderabad"
var address = "Ameerpet,Hyderabad";
|
|
Titanium.Geolocation.forwardGeocoder( address, function(evt)
|
{
|
Ti.API.info( "lat: "+evt.latitude+", long: "+ evt.longitude );
|
Ti.API.info( JSON.stringify(evt) );
|
});
|
Right now a workaround will be changing from "Ameerpet, Hyderabad" to "Ameerpet-Hyderabad", that will return the right coordinates, except in cases where you send a full address, like: "Shantipath, Chanakyapuri New Delhi, India", which is a valid address and will return empty.