Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-6685

Titanium.Geolocation component's "location" event does not work within parks, beaches, it only works on streets and roads

    Details

      Description

      Hello, I am making an application where I have to make a route track. Everything works fine but I have to enter the event Titanium.Geolocation.addEventListener ('location', locationCallback) in park or field zones;
      stop making calls, it's like it's deactivated. When I leave the park it works again.

      I am attaching the code in case you can please tell me what the problem may be .. Thanks in advance...

          // Create foreground service.
                              Ti.Geolocation.Android.manualMode = true;
                              var gpsProvider = Ti.Geolocation.Android.createLocationProvider({
                                name:              Titanium.Geolocation.Android.PROVIDER_GPS,
                                minUpdateTime:     1,  // 1 Buena
                                minUpdateDistance: 2  // 4 Buena prueba
                              });
                          
                              var gpsRule = Ti.Geolocation.Android.createLocationRule({
                                provider: Titanium.Geolocation.Android.PROVIDER_GPS,
                                accuracy: 20, //ACCURACY_BEST //Ti.Geolocation.ACCURACY_BEST // 20 buenos resultados
                                maxAge: 20000, //milisegundos //30000 buena pocos puntos
                                minAge:   10000, //milisegundos //10000 buena
                              });
                                 
                              Ti.Geolocation.Android.addLocationProvider(gpsProvider);
                              Ti.Geolocation.Android.addLocationRule(gpsRule);
                              Ti.Geolocation.activityType = Ti.Geolocation.ACTIVITYTYPE_OTHER_NAVIGATION; 
                              Ti.Geolocation.Android.manualMode = true;
       
       
       
                              var locationCallback = function(e) {
          if (!e.success || e.error) {
              //Ti.API.info('error:' + JSON.stringify(e.error));
          } else {
             Ti.API.info('Entra: ' + JSON.stringify(e.coords));
              Alloy.Globals.actualizaTrack(e);
          }
      };
       
      Titanium.Geolocation.addEventListener('location', locationCallback);
      

        Attachments

          Activity

            People

            • Assignee:
              amukherjee Abir Mukherjee
              Reporter:
              raul@rearmachine.com raul@rearmachine.com
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Git Integration