Project: titanium
Issue TIMOB-19022: Windows: Geolocation never returning data for getCurentPosition
This looks to be a mismatch in our implementation with the way the property is defined. We ask the current position status, but that value isn't "good" unless there's an active tracking session. The property is meant to convey if the app itself is set up to do location services, so it's more a check if they've set the DeviceCapability in their package/appx.manifest. I'm not sure if we can query capabilities at runtime or not. We might be able to do a simple call to the geolocator and catch exceptions to know if this property should be true or false. {code:javascript} Ti.API.info('GPS Enabled : ' + Ti.Geolocation.locationServicesEnabled); //if (Ti.Geolocation.locationServicesEnabled) { Ti.API.info('Setting accuracy...'); Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH; Ti.API.info('Asking for current position...'); Ti.Geolocation.getCurrentPosition(function(e) { Ti.API.info('Got current position!'); Ti.API.info('GPS Data : ' + JSON.stringify(e)); }); //} {code}
Story points: 5