@Sumeet123 wrote:
No matter what the timeout is set or whether the high accuracy is true or false !!
$cordovageolocation always returningerror code 3 error message Timeout expired
Heres my code :-
$ionicPlatform.ready(function() {
var posOptions = { enableHighAccuracy: false, timeout: 30000, maximumAge: 0 }; $cordovaGeolocation.getCurrentPosition(posOptions).then(function (position) { var lat = position.coords.latitude; var long = position.coords.longitude; //alert(lat); var FormData = { 'radius' : $localStorage.nearradius, 'latitude' : lat, 'longitude' : long }; $http({ method: 'POST', url: 'http://xyz.com/abc', data: FormData, headers: {'Content-Type': 'application/x-www-form-urlencoded','Authorization':undefined}, }) .success(function(data) { defer.resolve(data); }) .error(function(data) { }); }, function(err) { alert(err.code+" "+err.message); });
It always goes in function(err) ....
Code is wrapped inside ionic platform ready !
Help is appreciated !!
Posts: 1
Participants: 1