Hello i have already working the plugin, but when i run the app and the GPS is off then throw me the exception, that’s ok, but when i turn on the GPS keep throwing the error, i have to close the app and then run it again with the GPS turned on and then it works perfect, even when i turn it off throw error but when turn on again it works perfect.
the issue is when i run the app when is off.
index.html :
<script src="js/ng-cordova.min.js"></script>
controllers.js:
.controller('InfoController', function($scope, $cordovaGeolocation){
var posOptions = {timeout: 20000, enableHighAccuracy: true}
$scope.where = function(){
$cordovaGeolocation.getCurrentPosition(posOptions)
.then(function(position){
var lat = position.coords.latitude
var long = position.coords.longitude
alert('lat'+lat);
alert('long'+long);
location.href = location.origin;
}, function(error){
alert('error: '+error);
});
};
})
it runs on a Samsung Galaxy Note 3 with Android 5.0
Thank’s for any help you can give me.