function locationListener(location) {
Ti.API.info("Current Location: " + JSON.stringify(location.coords));
}
Titanium.Geolocation.distanceFilter = 1;
Titanium.Geolocation.purpose = 'Get Current Position';
Titanium.Geolocation.addEventListener('location', locationListener);
Output for the above code snippet shows the location as below:
{
"accuracy": 100,
"altitude": 0,
"altitudeAccuracy": null,
"heading": 0,
"latitude": 25.1166228,
"longitude": 55.390551,
"speed": 0,
"timestamp": 1454550108161
}
If we need the altitude value, should we add some extra parameters with it or at what conditions it can provide some value for altitude?
Hello, We tested this issue and observed the same output for altitude and altitudeAcccuracy. *Testing Environment:* Appcelerator Studio, build: 4.4.0.201511241829 Appcelerator Command-Line Interface, version 5.1.0 Titanium Command-Line Interface, CLI version 5.0.5, Titanium SDK version : 5.1.2 GA Mac OS X : 10.11.1 (EI Capitan) Device: walton primo v2(android 4.2.2) *Test Output:*
*Test Code:*
*Steps to test:* 1. Create a classic project. 2. Replace app.js with the above code 3. Run the app 4. Click on the window when the app opens and check the console output Thanks.
[~jnaher] can you test it on other devices as well?
Hi, I have tested it on Samsung S5 (Android L 5.0) and Spice Uno(Android M 6.0.1) and got the same response.
master: https://github.com/appcelerator/titanium_mobile/pull/11275
FR: Passed. PR merged.
Closing ticket, fix verified in SDK version
8.3.0.v20191023125529
. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11275