Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12615

iOS: Ti.Geolocation.forwardGeocoder is not getting Non US address to lat and long values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Won't Fix
    • Affects Version/s: Release 3.0.0
    • 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.

        Attachments

          Activity

            People

            • Assignee:
              vduggal Vishal Duggal (Inactive)
              Reporter:
              mpmiranda Mauro Parra-Miranda
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-15566
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration