navigator.geolocation.getCurrentPosition not working after turning the GPS off on the device even if it turned on again ? and also it keep getting error if i start the apps with the GPS is off and keep error even if the GPS turned on again while the App is runing, only if i start the App and the GPS is on … it work only in this situation. any solution ?
That’s because that method is only fired once. You either need something to detect when the GPS is turned ON/OFF and then call getCurrentPoisition , or use the watchPosition method.
@joseadrian i fire the getCurrentPosition from a button on my view, so its not only once, if i click this button and my GPS was on before starting the App it success , if i turend the GPS off and click this button i will get error and i will keep getting error even if i turn the GPS on again …
I have the exact same problem, when opening the app with the GPS on everything works, but if i turn off the GPS and on again I get Timeout error. same goes for opening the app if the gps is off, turning it on while inside the app dosent help.