Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3246] Ti.Geolocation doesn't update the latitude and longitude fast enough

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2015-01-20T06:05:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsTCSupportTriage, accuracy, coordinates, geocoder, geolocation, realtime
ReporterJune Rockwell
AssigneeMauro Parra-Miranda
Created2014-10-03T03:48:32.000+0000
Updated2016-03-08T07:57:39.000+0000

Description

Ti.Geolocation doesn't update longitude and latitude. Sometimes I have to wait at least 50 seconds for it to update the coordinates and sometimes it takes a few minutes. I'd either drive continuously for a few feet and sometimes for a few miles or I'd be walking around my house which is a pretty big spacious house and geolocation doesn't update longitude and latitude until I wait at least 50 seconds. This is the code: https://gist.github.com/jhrockwell/a0b6e39d6832a36a0d8b

Comments

  1. Amimul Hossain 2014-10-14

    Hello, I have tested this issue and it's working fine. I get it to update to the coordinates within 10 - 15 seconds.

    TESTING ENVIRONMENT

    MacOS X 10.9.5, iPod iOS 8.0 Mobile SDK: 3.4.0.GA

    CODE SAMPLE

    tiapp.xml

          <ios>
               <plist>
                   <dict>
                       <key>NSLocationAlwaysUsageDescription</key>
                       <string>
                           Specify the reason for accessing the user’s location information.
                           This appears in the alert dialog when asking the user for permission to
                           access their location.
                       </string>
                   </dict>
               </plist>
           </ios>
       

    app.js

       if (Ti.Geolocation.locationServicesEnabled) {
           Ti.Geolocation.purpose = 'Get Current Location';
           Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
           Ti.Geolocation.distanceFilter = 10;
           Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
       
           Ti.Geolocation.addEventListener('location', function(e) {
               if (e.error) {
                   alert('Error: ' + e.error);
               } else {
                   alert("Lat: " + e.coords.latitude + ";\nlong: "+ e.coords.longitude);
               }
           });
       } else {
           alert('Please enable location services');
       }
       
    Also i checked the KitchenSink sample. It's working fine too, Thanks.
  2. Mauro Parra-Miranda 2014-10-14

    Hello [~jhrockwell]! Can you please take a look into the posted test case and report back if it works for you? Thanks a lot! Best Regards!

JSON Source