Titanium JIRA Archive
Appcelerator Community (AC)

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

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sAppcelerator Studio 4.3.0
Fix Version/sn/a
ComponentsAppcelerator Modules
LabelsGeolocation, Track, beach, park
Reporterraul@rearmachine.com
AssigneeAbir Mukherjee
Created2021-02-24T09:40:52.000+0000
Updated2021-04-01T15:50:06.000+0000

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);

Comments

No comments

JSON Source